The Game of Reaction

Reaction is quite a simple little game whereby you have to press a push button as quick as you can when the LED changes from RED to GREEN. The faster your reaction time the lower the number that will be displayed on the seven segment display.

ReactionTitle

 

All the credit for this idea came from DJSPANKY one of the resident forum members. Thanks very much for the idea!

As stated above, the game is all about your reaction time. The Bi-colour LED will start out RED. It will then change to GREEN after a ‘seemingly’ random amount of time has passed (anywhere upto about 10 seconds). As soon as it turns to GREEN, that is the time to REACT! and you need to press the push button. The seven segment display will then show you your score (anywhere between 0 and 9) 0 is the fastest reaction time with 9 being the slowest.

 

Parts list

  • 1 x PIC 16f628a or 16f648a
  • 1 x Common anode seven segment display
  • 1 x bi-colour LED
  • 9 x 150 ohm resistors
  • 1 x 10k resistor
  • some hookup wire
  • 1 x momentary push-button
  • 1 x breadboard
  • PIC programmer

 

The schematic
SchematicSmall

You can download the full size schematic and the source code via the download link at the bottom of this page.

Here is a short youtube video of the game in action:
http://www.youtube.com/watch?v=A99fYihvaPw

Some things for you to try

Give it some more animations – or better animations to make the game a little more interesting? Make it so the game has levels. I.E. level 1 would be very simple and have a slow clock speed. Then you would increase the speed from there as you advanced in levels. Make more combinations of random numbers (I.E. I think I allowed for maybe 10 different loop timings from red to green) Maybe make it into a two player game? Two push buttons, two seven segment displays and one bi-colour LED. The first person to press their button when the LED changes get’s one point. The first to nine points wins.

Here is the Reaction Game download containing the source code and schematic:

Downloads

ReactionFiles