adccommunitymod (AutomationDirect) asked a question.

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

Created Date: March 05,2020

Created By: ADC_CommTeam02

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

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: T his 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


  • adccommunitymod (AutomationDirect)

    Created Date: March 05,2020

    Created by: ADC_CommTeam02

    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: T his 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

    Expand Post