An Arduino-based interactive game that teaches players to input Morse code using a physical button. Players progress through three difficulty levels by correctly spelling words in Morse code within a 24-second time limit. ⏱️
- Wire up the circuit (see pin configuration below)
- Upload
morse_trainer.inoto your Arduino Uno - Open Serial Monitor at 115200 baud
- Press the morse button to start the game 🟢
- A target word will appear in the Serial Monitor
- Input each letter using dots (short press) and dashes (long press)
- Pause for 800ms between letters to commit them
- Get 3 words correct to advance to the next level 🏆
- You have 3 lives — lose one for each wrong word, skip, or timeout
💡 New to Morse code? Check out the Morse Code Reference!
| Level | Words to Advance |
|---|---|
| 🟢 Beginner (3 letters) | 3 |
| 🟡 Medium (4 letters) | 3 |
| 🔴 Hard (5 letters) | 3 |
| Pin | Function |
|---|---|
| 4 | LED1 - turns off at 8s |
| 5 | LED2 - turns off at 16s |
| 6 | LED3 - turns off at 24s |
| Pin | Function |
|---|---|
| 11 | LIFE1 |
| 12 | LIFE2 |
| A0 | LIFE3 |
| Pin | Function |
|---|---|
| 3 | Morse input (polled) |
| 2 | OR-gate output of all 4 game buttons (INT0) |
| 7 | Next level ⏩ |
| 8 | Back level ⏪ |
| 9 | Reset game 🔄 |
| 10 | Skip word (costs a life) |
- Arduino Uno
- 6x LEDs with resistors (3 blue, 3 red)
- 5x push buttons
- 1x OR gate chip (74HC32) to combine game buttons into pin 2
- Pull-down resistors (10kΩ) on each button input
💡 Note: All 4 game buttons feed into a 74HC32 OR gate. The OR gate output connects to pin 2. Each button also has its own direct sense line to pins 7–10 so the ISR can identify which button was pressed.
morse_trainer/
├── morse_trainer.ino # main game logic
├── morse_lookup.h # morse code character lookup declarations
├── morse_lookup.cpp # morse code character lookup implementation
└── word_bank.h # beginner, medium, and hard word banks
- Uses Timer2 in CTC mode at 1ms intervals to replace
millis() tickCountis the single time source for all timed events- No Arduino time functions (
millis(),delay(),tone()) are used anywhere
- Dot vs dash classification (200ms threshold)
- Inter-letter gap detection (800ms silence)
- 24-second word countdown
- Message display hold (2 seconds)
- Freezes game for 2 seconds so player can read feedback, then loads next word
- Fail state pause (1 second)
- All timer LEDs turn off for 1 second to signal time's up, then loads next word
- All 4 game buttons are OR-gated into a single interrupt pin (pin 2 / INT0)
gameButtonISR()reads individual sense pins to identify which button fired- Timer2 ISR increments
tickCountevery 1ms
Kaitlyn Van and Natasha Poon