Good evening to all of you,
I am looking to make a LOOP of a determined duration and 1) EXIT this loop as soon as a button has been activated or 2) light a red led if this button has not been activated during the determined time ... and continue the rest of the program.
This would be the principle of arming an Alarm.
(The program does not loop. This is a single check of an action to be performed within a specified time.)
Start of the program by supplying the Picaxe
So We have 20 seconds to push a button. (System arming)
1) If the button is activated during this period, we exit the 20 second loop (we do not wait for the end of the 20 seconds) and a green LED is lit.
2) If this 20 second period has elapsed, the button has not been activated: A red LED lights up.
And we continue, outside this timed loop, until the end of the program.
I think the BUTTON instruction might be the best one, but I don't understand how to calibrate exactly how long I want.
Would another method be better?
Already, Thanks to the Team.
I am looking to make a LOOP of a determined duration and 1) EXIT this loop as soon as a button has been activated or 2) light a red led if this button has not been activated during the determined time ... and continue the rest of the program.
This would be the principle of arming an Alarm.
(The program does not loop. This is a single check of an action to be performed within a specified time.)
Start of the program by supplying the Picaxe
So We have 20 seconds to push a button. (System arming)
1) If the button is activated during this period, we exit the 20 second loop (we do not wait for the end of the 20 seconds) and a green LED is lit.
2) If this 20 second period has elapsed, the button has not been activated: A red LED lights up.
And we continue, outside this timed loop, until the end of the program.
I think the BUTTON instruction might be the best one, but I don't understand how to calibrate exactly how long I want.
Would another method be better?
Already, Thanks to the Team.