2-Player Multiplayer Reaction Game – Player 2
by DESHBOT in Circuits > Arduino
15 Views, 0 Favorites, 0 Comments
2-Player Multiplayer Reaction Game – Player 2
The objective of this project is to create a multiplayer reaction-time game using two Arduino Nano/UNO boards. The second board acts as Player 2's controller, using an OLED display and a push button.
The two Arduino boards communicate with each other using TX and RX serial communication.
Supplies
Deshbot shield x2
Arduino Nano/UNOx2
0.96-inch 128×64 OLED display x1 ,
lcd 16x2 x1
Push button
Jumper wires x3
Connections
OLED Display
OLEDArduino Nano/UNO
VCC v- 5V
GND - GND
SDA - A4
SCL - A5
Player 2 Button
ButtonArduino
One pin - D12
Other pin - GND
Nano-to-Nano Communication
Player 2 BoardPlayer 1 Board
TX (D1) - RX (D0)
RX (D0) - TX (D1)
GND - GND
Working
- Player 2's Arduino starts and displays PLAYER 2 – READY on the OLED.
- Player 1 starts a new round.
- Both boards receive the START command.
- The game waits for a random amount of time.
- The Player 2 OLED displays GO!!! PRESS!
- Player 2 presses the button as quickly as possible.
- The Arduino measures the reaction time in milliseconds.
- Player 2's reaction time is sent to Player 1 through TX/RX.
- The OLED displays Player 2's reaction time.
- The same process can be repeated for multiple rounds.
Example OLED Display
Before the Game
During the Game
After Pressing
Communication
Serial communication is used between the two Arduino boards.
- TX sends information.
- RX receives information.
- GND provides a common electrical reference.
The Player 2 board sends the reaction time in the format:
where 428 represents the reaction time in milliseconds.
Result
The project creates a two-player reaction game in which Player 2 uses an OLED display and button while communicating with the other Arduino through TX/RX. The system measures and displays the player's reaction time.
Conclusion
This project demonstrates how two Arduino boards can communicate with each other while simultaneously handling user input and an OLED display. It combines buttons, OLED graphics, timing, and UART serial communication to create a simple multiplayer game.