Hi Community!
The project consists of a mockup which has an Arduino MEGA, 4 buttons, 4 LEDs, an LCD screen with I2C, and a buzzer. The game is based on testing the reflexes of the players, there is a "boss" who presses a button, which activates a green LED that turns on between 1 to 10 seconds, at the moment this LED turns off, the players must press their button which will activate its LED (red, yellow or white), the fastest to press the button wins, there are 3 rounds and the best of 3 wins. At the end the LCD will display the winner and points!
Software used
- • Arduino IDE
Components used
- • LEDs
- • Speaker
- • Buttons
- • Resistors
- • Arduino MEGA
- • LCD with I2C module
Development Setup
- • include "pitches.h"
- • include Wire.h
- • include LiquidCrystal_I2C.h
- • include SPI.h
Step by step
First we have to include pitches.h file on the smae directory we're gonna do our code. We start this with including the libraries and writing the variables we'll be using on our code:
Now we start configuring the LCD and all the pins we'll be using, also giving our variables numbers to later make counters and more:
Then we make a loop to start our game, pressing the button and also conditioning we didn't played before:
We add a menu option were you can read the instructions too:
And start doing our winning options (if any of the three users gets more than 3 points)
Finally we get to see each users points and who won!
Make sure to check our github code about 3 Players Reflex Game where you can download and use it!
Github Code!