There's an odd quirk with the time variable I've noticed once before and now again when programming a countdown timer setup which uses a single button for control.
I coded it so pressing and holding the button down for one second turns off the countdown timer, but the time needed to hold the button down is never one second it's always less than one second. The specific piece of code works like this:
It appears that setting the time variable to 0 doesn't reset whatever controls the incrementation of the time variable. Is there a way of resetting that thing?
I'm using a breadboarded 18m2 but will transfer code+circuit to a soldered 08m2.
I coded it so pressing and holding the button down for one second turns off the countdown timer, but the time needed to hold the button down is never one second it's always less than one second. The specific piece of code works like this:
Code:
time=0
do while pushbutton=1
loop
if time>1 then:(turn off countdown code here):endif
I'm using a breadboarded 18m2 but will transfer code+circuit to a soldered 08m2.