Hi all. I hope someone can help with the code for me.
I'm trying to make a timer that does the following (it's to activate a lamp when a PIR sensor detects movement):
It monitors the state of an input. When the input momentarily goes LOW, a timer starts for 20 seconds sending an output HIGH (to drive a relay).
If the same input momentarily goes LOW again during the 20 seconds, the timer effectively starts again, leaving the output activated for a further 20 seconds.
The problem I am having seems to be monitoring the state of the i/p during the 20 second period. I'm currently using the 'pause' command which effectively halts the program for 20 seconds before moving on, ignoring any change to the i/p.
Ideally I'd like to use the 08M or 08M2. Thanks in advance
I'm trying to make a timer that does the following (it's to activate a lamp when a PIR sensor detects movement):
It monitors the state of an input. When the input momentarily goes LOW, a timer starts for 20 seconds sending an output HIGH (to drive a relay).
If the same input momentarily goes LOW again during the 20 seconds, the timer effectively starts again, leaving the output activated for a further 20 seconds.
The problem I am having seems to be monitoring the state of the i/p during the 20 second period. I'm currently using the 'pause' command which effectively halts the program for 20 seconds before moving on, ignoring any change to the i/p.
Ideally I'd like to use the 08M or 08M2. Thanks in advance