A physical hardware version of the classic Minesweeper game built with an Arduino, 7 tactile buttons, and a piezo buzzer. This version features "Software Shielding" to prevent ghost-presses and a full 4-second victory fanfare!
- The Board: 7 buttons represent hidden tiles. 6 are safe, and 1 is a deadly mine.
- The Goal: Press all 6 safe buttons without hitting the mine.
- Hardware Reset: The game detects if buttons are stuck down and will only start once the board is cleared.
- Microcontroller: Arduino Uno (or compatible)
- Input: 7x Tactile Pushbuttons
- Output: 1x Passive Piezo Buzzer
- Breadboard & Jumper Wires
| Component | Arduino Pin |
|---|---|
| Buttons 1-7 | Pins 2, 3, 4, 5, 6, 7, 8 |
| Buzzer (+) | Pin 9 |
| All Grounds | GND Rail |
Note: Buttons use internal
INPUT_PULLUPresistors, so no external resistors are required for the buttons!
- Ready Beep: High-pitched chirp when the game starts.
- Safe Beep: Quick chirp when a safe button is cleared.
- Explosion: A low-frequency 1.5s "thud" if you hit the mine.
- Victory Fanfare: A complex 4-second rising scale and rhythmic pulse.
- Download the
Arduino-Minesweeper.inofile. - Open it in the Arduino IDE.
- Select your board (Arduino Uno).
- Click Upload.
- Open the Serial Monitor (9600 Baud) to see the game status and admin debug messages!
- Anti-Ghosting: Includes a 50ms software debounce to filter electrical noise.
- Mechanical Stability: Includes a
waitForHardwareResetfunction to ensure mechanical buttons are fully released before a new game begins. - Randomization: Uses atmospheric noise from an empty Analog pin to ensure the mine moves every game.