Reaction timer
obdi
Posts: 1
Hello,
i need help i must program a reaction timer for my university but i cant program the code
Here is the task:
Can you help me?
(sorry for my bad english)
i need help i must program a reaction timer for my university but i cant program the code
Here is the task:
Press and hold the pushbutton to make the light turn red. When the
light turns green, let go of the push button as fast as you can��
light turns green, let go of the push button as fast as you can��
The program should output the use the instructions and, after the test is
complete, the time (in milliseconds) it took for the user to react to the green
light.complete, the time (in milliseconds) it took for the user to react to the green
Can you help me?
(sorry for my bad english)
Comments
You haven't said how the program is supposed to output the user instructions. If you're using a Basic Stamp, is this supposed to appear on the attached PC's debug window or a separate display of some kind?
Usually timing on this order (milliseconds) is done by using the time it takes to do a couple of statements in PBasic and counting the number of times those statements can execute before the end condition is met, then adjusting for the time that it takes for one time through the loop. This website has lots of information on timing with a Basic Stamp. Use the "app-notes" link. Ask more questions as you go along.
Generally, the more information you provide and the more specific you can make your questions, the more information you will get in return. When posting code, use the Go Advanced button and attach your source code files to a message. Do not use cut and paste to include code with your messages.