This is an advanced multi-team Reaction Time Game built using Arduino with enhanced features including persistent data storage, multiple difficulty modes, comprehensive statistics, and improved user experience.
- 3 Difficulty Modes: Easy, Normal, and Hard with different timing parameters
- Improved Visual Feedback: Dynamic RGB LED colors and animated responses
- Better Audio: Multi-pulse tones and celebration sounds
- Performance Categories: From "INCREDIBLE!" to "Too slow!" with appropriate feedback
- Persistent Data Storage: Team statistics saved in EEPROM
- Comprehensive Tracking: Best time, average time, games played, and fast reactions count
- Individual Team Records: Each team maintains separate statistics
- New Record Celebrations: Special animations and sounds for new best times
- Interactive Menus: Navigate between game modes and statistics
- Long Press Functions: Hold button for 2 seconds to view team statistics
- Auto-rotation: Automatic team switching after each game
- Startup Animation: Beautiful RGB color cycle on boot
- Timeout Protection: Auto-return to main menu after inactivity
- Fixed Pin Naming: Corrected blue pin naming (was incorrectly named yellowPin)
- Better Code Organization: Structured functions and clear separation of concerns
- Enhanced Error Handling: Better early-press detection and user feedback
- Memory Efficient: Optimized data structures for EEPROM storage
- Arduino UNO
- 16x2 I2C LCD Display (address 0x27)
- RGB LED (Common Cathode)
- Red: Pin 11 (PWM)
- Green: Pin 10 (PWM)
- Blue: Pin 9 (PWM)
- Push Button (Pin 2)
- Buzzer (Pin 8)
- Resistors: 3x 220Ω (for RGB LED), 1x 10kΩ (pull-up for button)
- VS Code
- PlatformIO extension
- Wokwi extension (for simulation)
-
Clone the Repository
git clone https://github.com/noiz-x/reaction-time cd reaction-time
-
Open in VS Code Launch VS Code and open the project folder.
-
Build the Project
pio run
-
Run Simulation (Optional) Use
Wokwi: Start Simulator
from the Command Palette.
- Short Press: Select/Start game
- Long Press (2 seconds): View team statistics
- In Game Mode Menu: Press to cycle through Easy → Normal → Hard
-
Main Menu
- Shows current team name
- Press button to enter game mode selection
- Hold button to view statistics
-
Mode Selection
- Easy Mode: Longer delays (2-6s), slower countdown (1200ms)
- Normal Mode: Standard delays (1-5s), normal countdown (1000ms)
- Hard Mode: Quick delays (0.5-3s), fast countdown (800ms)
-
Game Round
- 3-second countdown with RGB visual feedback
- Random delay period (varies by difficulty)
- "GO!" signal with white LED and high-pitched tone
- Press button as quickly as possible!
-
Results & Feedback
- < 150ms: "INCREDIBLE!" (Cyan LED, celebration)
- 150-199ms: "Lightning Fast!" (Green LED)
- 200-299ms: "Excellent!" (Light Green LED)
- 300-499ms: "Good Job!" (Blue LED)
- 500-799ms: "Not bad!" (Yellow LED)
- 800ms+: "Too slow!" (Red LED)
-
Statistics Tracking
- Best reaction time recorded
- Running average calculated
- Fast reactions (< 200ms) counted
- All data automatically saved to EEPROM
- 6 Default Teams: Alpha, Beta, Gamma, Delta, Echo, Foxtrot
- Automatic Rotation: Teams cycle after each game
- Individual Records: Each team maintains separate statistics
- Persistent Storage: Data survives power cycles
- Best Time: Fastest reaction time ever recorded
- Games Played: Total number of games completed
- Average Time: Running average of all reaction times
- Fast Reactions: Count of reactions under 200ms
- Hold button for 2 seconds in main menu
- Cycles through all teams automatically
- Shows best time and games played on LCD
- Detailed statistics available via Serial Monitor
// Modify team names (max 8 characters for LCD display)
const char* defaultNames[] = {"Team1", "Team2", "Team3", "Team4", "Team5", "Team6"};
const GameModeSettings gameModes[] = {
{minDelay, maxDelay, countdownSpeed, "ModeName"},
// Customize timing parameters as needed
};
// Add new performance categories with custom colors
void processReactionTime() {
// Add custom time ranges and RGB colors
}
// Modify tone frequencies and patterns
void playTone(int frequency, int duration, int pulses);
- Magic Number: 0xAB for data validation
- Team Data Structure: Name, best time, games played, total time, fast reactions
- Auto-Save: Data automatically saved after each game
- Data Recovery: Initializes defaults if EEPROM data is invalid
const int redPin = 11; // RGB Red (PWM)
const int greenPin = 10; // RGB Green (PWM)
const int bluePin = 9; // RGB Blue (PWM)
const int buttonPin = 2; // Push Button
const int buzzerPin = 8; // Buzzer
- Baud Rate: 9600
- Debug Output: Game events, statistics, and system status
- Team Information: Detailed performance data logging
- LCD Not Displaying: Check I2C address (default 0x27)
- Button Not Responsive: Verify pull-up resistor (10kΩ)
- RGB LED Issues: Ensure PWM-capable pins and correct wiring
- Statistics Not Saving: Check EEPROM functionality
- Timing Issues: Verify crystal oscillator on Arduino
Enable verbose serial output for troubleshooting:
#define DEBUG_MODE 1 // Add to top of main.cpp
- Use appropriate resistors to prevent LED damage
- Ensure proper power supply (5V for Arduino UNO)
- Verify all connections before powering on
- Use debounced button handling to prevent false triggers
- LiquidCrystal_I2C: v1.1.4 - LCD display control
- EEPROM: Built-in - Persistent data storage
- Arduino: Standard Arduino framework
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Original concept inspired by classic reaction time games
- Enhanced with modern Arduino capabilities
- Community feedback and testing
Happy Gaming! 🎮⚡