Two Player Reflex Game With Arduino

Introduction: Two Player Reflex Game With Arduino

Photo credit: Portrait of the Gemini 8 prime crew(license)

You've mastered the Reflex Tester 2000. Now you'll experience the next
level in modern-age space flight testing technology: The Reflex Tester 2000 and 1! The latest version allow us to pit hopeful recruits head-to-head and see who's really the best. Report to HQ and get to work.

Example of the finished game:

Step 1: Gather Materials

To make a reflex tester 2001, you'll need the following items:

1 Arduino UNO

3 Buttons

13 Jumper Wires

1 Breadboard

3 LEDs

1 USB B Cable

3 10k Resistors

Step 2: Assemble the Circuit 1

Follow the image above to connect power from the Arduino to both rails on each side of the breadboard.

Step 3: Assemble the Circuit 2

Follow the wiring diagram above to hook up the buttons.

Step 4: Assemble the Circuit 3

Follow the wiring guide above to connect the buttons to the pins on the Arduino and the the resistors.

Step 5: Assemble the Circuit 4

Finally, follow the wiring diagram above to hook up the LEDs.

Step 6: Upload the Code

Upload the following code using CodeBender or copy/paste it into the Arduino IDE.

Step 7: Play the Game

Open the serial monitor in CodeBender or the Arduino IDE.

Power up your Arduino, then press the game start button (The button connected to Pin 12.) The start LED (The LED connected to Pin 11) should flash once, this indicates the test has begun.

The next time you see the LED flash, press your button faster than your opponent. The winner's indicator LED will turn on and the serial monitor window will show both player's reaction time and by how much the winning player won by. The system will also keep a running tally of wins.

Step 8: Next Steps

See if you can add features like buzzer noises, penalties for pressing the button too soon, or a best-two-out-of-three system.

For more open source Arduino-based missions and science experiments, visit our lessons page at http://www.ardusat.com.

Tech Contest

Participated in the
Tech Contest

Time Contest

Participated in the
Time Contest

Make It Glow! Contest

Participated in the
Make It Glow! Contest

Be the First to Share

    Recommendations

    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • PCB Challenge

      PCB Challenge

    6 Discussions

    0
    Rocky2000balboa
    Rocky2000balboa

    Question 1 year ago

    Hello, I don't understand I copied exactly the instructions but the game don't functione.
    The led in the begin of the game falshes and sometimes the led of player one is on.
    The time is random and player one win everytime.Please help me now it s urgent.

    0
    Rocky2000balboa
    Rocky2000balboa

    Answer 1 year ago

    and when anyone push a button player 2 win...

    0
    tcrawford6
    tcrawford6

    5 years ago

    I copied this exactly as you described it and it worked first time! Excellent instructable! I modified the code slightly to measure in microseconds, so that the time difference is reported in milliseconds.

    0
    ArdusatCHoffman
    ArdusatCHoffman

    Reply 5 years ago

    Awesome, glad it worked. Would you mind sharing your code so we could add it as an option?

    0
    tcrawford6
    tcrawford6

    Reply 5 years ago

    I just edited the code in subroutine startGame(), changing the units from 'millis' to 'micros' (lines 93, 100 and 105). That means the reflex times are posted in milliseconds, but it's easier to measure the differences in those units.

    0
    tomatoskins
    tomatoskins

    5 years ago on Introduction

    Hahaha this is awesome! I'd love to see a video of someone playing it!