Menu

Reaction Time Game Connect Led Pushbutton Two Different Pins Program Starts Turn Led Rando Q43890725

Reaction time game. Connect an LED and a Pushbutton totwo different pins. When the program starts, turn on the LED for arandom time between 3 and 5 seconds. When the LED goes off, starttiming in milliseconds. When the player presses the pushbutton stoptiming and display his reaction time on the screen in exactly theformat below where “X” is the number of milliseconds:

Your reaction time is X milliseconds.

What is your best reaction time? __________

What happens if you push the button just before the LEDgoes off and hold it?

Now modify your program to print “You cheated” ifthe player pressed the button before the light went out and printthe previous “Your reaction time is X milliseconds” if they didn’tcheat. Hint, no one is faster than 150ms, so if it’s less thanthat, then they cheated.

*EDIT*

The program is to be written for anArduino

Expert Answer


Answer to Reaction time game. Connect an LED and a Pushbutton to two different pins. When the program starts, turn on the LED for …

OR