MrDEB
Well-Known Member
this dosent work but ging to ponder on i and get a fresh start tomrrow
Code (text):
WHILE True
delayms(2000) // insert a random # here
mS = 0
green = 0 //turn on green until button is pressed
Timer.Start //start timing reaction time
if button = 0 and green = 1 //green is not enabled but button is pressed
then red = 0 //turn on red led
delayms(2000)
timer.stop
end if
REPEAT
UNTIL
button = 0 // button pressed then turn off green, turn on blue
green = 1 //off
blue = 0 //on
Timer.Stop //stop timer
' WriteAt(1,1,"reaction=",DecToStr(mS),"ms",4)
s = DecToStr(ms/1000) + "." + DecToStr((ms MOD 1000), 3) + "secs"
WriteAt(1,1,"reaction=",s,2)
DELAYMS(3000)
blue = 1 //led is off
red = 1
DELAYMS(1000)
WEND