MrDEB
Well-Known Member
want to display the elapsed time between when green led turns on and button is pressed.
My target is to display say 4.025 seconds or 10.675 seconds. note 6 digits
experimenting with different math. Does not need to be real accurate but would be nice.
My target is to display say 4.025 seconds or 10.675 seconds. note 6 digits
experimenting with different math. Does not need to be real accurate but would be nice.
Code:
While true
blue = 0
DelayMS(2000)
blue = 1
green = 0 //go
Repeat
DelayUS(time)
Inc (time)
Until button = 0
green = 1
time = time * 2
WriteAt(1,1,"YOUR REACTION",4)
WriteAt(2,1,"Time = ",Dectostr(time)," ms",6)
DelayMS(2000)
time = 0 //reset to zero
Wend
Last edited by a moderator: