Announcement

Collapse
No announcement yet.

P1AM-100 State change detection switch (edge detection) Example

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • P1AM-100 State change detection switch (edge detection) Example

    The information provided in the AutomationDirect knowledge base is provided "as is" without warranty of any kind. AutomationDirect disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall AutomationDirect or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if AutomationDirect or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion of limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.

    Purpose: This example shows how to detect when the P1AM-100 Toggle Swith changes from off to on and on to off.

    Often, you don't need to know the state of a digital input all the time, but you just need to know when the input changes from one state to another. For example, you want to know when a button goes from OFF to ON. This is called state change detection, or edge detection.

    The circuit:
    • Toggle Switch on P1AM-100 "SWITCH_BUILTIN"
    • LED attached to P1AM-100 "LED_BUILTIN"
    Dependencies: Required Library which needs to be installed.
    https://github.com/facts-engineering/P1AM

    Check out the code here:
    https://github.com/AutomationDirect/...etectionSwitch
Working...
X