Welcome to the Arduino Accuracy Game! This project allows you to create a fun target shooting game using Arduino and ESP32/ESP8266 microcontrollers. The game consists of two main components: Targets and Timer.
The Targets code controls the behavior of each target in the game. Each target is equipped with an IR receiver to detect hits and a NeoPixel LED strip to indicate the hit status. Targets communicate with the Timer using the ESP-NOW protocol.
- Adafruit_NeoPixel library
- IRremote library
- ESP-NOW library
- WiFi library
- NeoPixel LED strip
- IR receiver module
- ESP32 microcontroller
- ESP8266 microcontroller (optional)
- Target ID: Change the
TARGET_ID
variable in the code to assign a unique ID to each target. - Total Number of Targets: Update the
totalTargets
variable to match the actual number of targets in your setup. - MAC Address: Manually add the MAC address of the Timer to the
targetMACs
array in the Targets code.
- Install the required libraries.
- Upload the code to your ESP32/ESP8266 board.
- Connect the components according to the pin configuration.
- Power on the targets and ensure they are within range of the Timer.
The Timer code serves as the central control unit for the game. It manages the countdown, tracks hits on targets, and determines the end of the game. The Timer communicates with the Targets using the ESP-NOW protocol.
- ESP-NOW library
- WiFi library
- ESP32 microcontroller
- MAC Address: Manually add the MAC address of each target to the
targetMACs
array in the Timer code.
- Upload the code to your ESP32 board.
- Connect the reset button according to the pin configuration.
- Power on the Timer and ensure it is connected to the same Wi-Fi network as the Targets.
This code snippet can be used to extract the MAC address of an ESP32 or ESP8266 board. It is helpful for obtaining the MAC addresses required for communication between the Timer and Targets.
- WiFi library
- Upload the code to your ESP32/ESP8266 board.
- Open the serial monitor to view the MAC address printed by the board.