Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - macman31

Pages: [1]
1
Ok, thank you for your answer!

2
mc-Module / [ISSUE] RisingEdge + FallingEdge events in the same script
« on: August 06, 2016, 03:27:44 pm »
Hello,

I'm trying to make the following script work:

Code: [Select]
Define PinMode Pin0 As DigitalInputPullDown
Class PIR
    Shared Event Boot()
        LedGreen = False
        LedRed = False
    End Event
    Shared Event Pin0RisingEdge()
        LedRed = True
        Thread.Sleep(100000)
        LedRed = False
    End Event
    Shared Event Pin0FallingEdge()
        LedGreen = True
        Thread.Sleep(100000)
        LedGreen = False
    End Event
End Class

The issue is that with the latest availble versions of the different softwares, only the FallingEdge event is executed.
The green LED lights as expected on FallingEdge events, but nothing happens on RisingEdge events.

If I comment the falling edge event, then the rising edge event is executed on rising edges: the red LED lights!

My question is: why this behavior? What am I missing? How can I script the behavior "red LED on rising edge on pin 0, green LED on falling edge on pin 0"?

Thanks!

Pages: [1]