Timer
Thumbs
Posts: 2
I am using the loop function on the bs2 for a timer( t = t+1) and would like to capture a·lap time by presing a button while the timer is still running . Is this possible?
thanks.
thanks.
Comments
·· Not sure how accurate your timer will be, but in your loop you can do an IF...THEN to determine if the button is pressed.· For example, if it's active low, you could use:
IF IN0 = 0 THEN
·· ' SAVE LAP TIME?
ENDIF
inside your loop...Depending on the speed of your loop you may need to add exclusion to the IF statement so it only executes once.· It would help to see the code you're using for the loop/timer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
and then in the subroutine
write to data to recall later
that way your timer routine will loop and you would loose time throught the
write execution
Get_InputSignal:
Debug CLS, ? InputSignal
Pause DelayReader
Write 7 , InputSignal
Return
this way you can hit the button and keep your loop going ,
this was used to get the state of pin #7 but you get the idea
you will still loose time
not far advanced yet to Calc_ loss of time with an algorithm but do able