clocking R/C car time
Macgman2000
Posts: 59
Hello all,
I have an application for clocking the time it takes to go between 2 points 10' apart. I am using IR LEDS and IR-modules. I want the timer to start when pointA IR is interrupted and stop when pointB IR is interrupted and display the time interval (most likely in milliseconds).
I would appreciate any help!!!!
The IR receive modules are pulled high via 5k resistors and when illuminated by IR goes low.
Best Regards,
Nick
I have an application for clocking the time it takes to go between 2 points 10' apart. I am using IR LEDS and IR-modules. I want the timer to start when pointA IR is interrupted and stop when pointB IR is interrupted and display the time interval (most likely in milliseconds).
I would appreciate any help!!!!
The IR receive modules are pulled high via 5k resistors and when illuminated by IR goes low.
Best Regards,
Nick
Comments
Do your IR-modules go high or low when the beam is broken ?
How do you want the time interval displayed (LCD, LED ect) ?
That should be fairly easy if you use SX/B.
Basically the code would look like this (assuming the IR-modules go high when beam is broken, and the maximum time is·< 65·seconds)
· CountL=0
· CountH=0
WaitStart:
· IF IR1 = 0 THEN WaitStart
TimeIt:
· PAUSE 1
· INC CountL
· CountH=CountH + C
· IF IR2 = 0 THEN Timeit
' Total time is (CountL + CountH*256) milliseconds
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video Display Module" Available Now.
www.sxvm.com
"A problem well defined, is a problem·half solved."
Post Edited (Bean) : 4/17/2005 1:50:43 AM GMT
Thanks!!!
Best Regards,
Nick
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video Display Module" Available Now.
www.sxvm.com
"A problem well defined, is a problem·half solved."
·