EE 476: Laboratory 2

Reaction Time Tester.

Introduction.

For this exercise you will use the development board to build a human reaction time tester. The pushbuttons, LCD, and the mcu will be used to see how fast you can push a button after a light flashes.


Procedure:

You will need to generate a time base for measuring reaction times. Most people have a reaction time in the range of 100 mSec to 200 mSec, but this can be quite variable, up to several hundred mSec.I suggest that you use the multiple task timing scheme from Lab 1.

Make sure that the switches and LCD are connected as they were in Lab 1. When in doubt, ask an instructor. Remember that a switch which is pushed reads back a logic zero.


Assignment

Produce an C language program which:

  1. Upon a reset signal, flash the LEDs on the development board at a few Hz and wait for a button 0 press.
  2. At the button press, turn the LEDs off for about 2 seconds. Figure out a way to make the waiting time variable, so that it is harder to predict.
  3. After the variable time delay, turn on the LEDs, start a timer and wait for a button press. (your code should detect the cheating condition of a pressed button at t=0 and respond by returning to the flashing LEDs).
  4. At the button press, compute the time between LED illumination and the button press, display the number of millseconds in decimal on the LCD, then waits. Displayed time should be accurate to 1 mSec.
  5. Returns to the flashing LEDs when button 7 is pushed.

You will demonstrate the working reaction time tester to the TA in the lab.

Your written lab report should include:


Copyright Cornell University Jan 2002