Caporegime
I'm trying to wrap my brains around getting the following to work:
A timer is set for 5 minutes which then begins to count down, if a GPIO pin goes high, a command is executed then the timer is reset back to 5 minutes, however if it goes low, the timer continues to run out, when the timer reaches zero, a command is executed.
I think I'm going to have to use threading to do this? I'm using a callback from the GPIO.add_event_detect but I can't get my head around the logic required to make this work.
A timer is set for 5 minutes which then begins to count down, if a GPIO pin goes high, a command is executed then the timer is reset back to 5 minutes, however if it goes low, the timer continues to run out, when the timer reaches zero, a command is executed.
I think I'm going to have to use threading to do this? I'm using a callback from the GPIO.add_event_detect but I can't get my head around the logic required to make this work.