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.

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. 1 x PIC 16f628a or 16f648a

  2. 1 x Common anode seven segment display

  3. 1 x bi-colour LED

  4. 9 x 150 ohm resistors

  5. 1 x 10k resistor

  6. some hookup wire

  7. 1 x momentary push-button

  8. 1 x breadboard

  9. PIC programmer

The schematic

You can download the fullsize schematic here

You can download the sourcecode here

If you have a look through the sourcecode, you may notice that it is not the most efficient way to write a game like this. I sort of just started out with making the LED's do their thing and then it just flowed from there. Nevertheless it only uses about 220 bytes of program memory so it's not like were going to run out of storage space!