I built a reaction time game using an Arduino Nano!
Here's the project:
How to build?The build is really easy to set up.
Starting with the buttons:
- White Button to Pin 2
- Red Button to Pin 3
- Green Button to Pin 4
- Blue Button to Pin 5
- All Buttons to GND
Next, the Buzzer:
- Connect to Pin 6
- Connect to GND
(depending on your buzzer, your setup may look a little different. should be fine as long as the input pin is correct)
After that, the LED:
- Connect red channel to Pin 9
- Connect green channel to Pin 10
- Connect blue channel to Pin 11
- Connect to GND
- Place 220 Ohm resistors between cables and LED on the color channels
Finally, the display:
- VCC to 5V
- GND to GND
- DIO to Pin 7
- CLK to Pin 8
You will also need the TM1637 Library, which you can find here.
How to play?Here's the game:
Upon uploading the code, the game will begin.
The LED will blink 3 times. Red, Orange, then Yellow. The buzzer will also make a countdown sound. After the 3rd beep, the game actually starts.
Main RulesThe LED will display a random color.
Click the button that is the same as that color. Doing this successfully will give you a point, and the display will update.
Click a button that doesn't correspond to the color, and nothing happens. (challenge: try to code in a penalty for getting it wrong :D)
The game will last 30 seconds.
After the 30 seconds, a long beep will happen and the game freezes.
Your total points will blink on the display.
I also made a YouTube Short covering the build process as well as a gameplay demo. Feel free to watch it! <--- link
Thank you for reading.
Comments
Please log in or sign up to comment.