Hi
Bear with me, I'm new to this stuff
I'm writing an application that needs to respond to the user holding a push button down for 3 or more seconds.
The program is doing nothing else, except waiting for the key press.
This is the code I'm using
Is this the best way of doing this?
Thanks
Bear with me, I'm new to this stuff
I'm writing an application that needs to respond to the user holding a push button down for 3 or more seconds.
The program is doing nothing else, except waiting for the key press.
This is the code I'm using
Code:
Do : Loop Until pin1 = 1 'wait for button press
wait 3 'wait 3 seconds
if pin1=1 then 'if its still pressed then...
do : loop until pin1=0 'wait for button to be released
'respond to button press event.
endif
Thanks