Skip to content

arzaanxeng/Arduino_Minesweeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฃ Arduino Piezo Minesweeper

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!

๐ŸŽฎ How it Works

  • 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.

๐Ÿ› ๏ธ Hardware Requirements

  • Microcontroller: Arduino Uno (or compatible)
  • Input: 7x Tactile Pushbuttons
  • Output: 1x Passive Piezo Buzzer
  • Breadboard & Jumper Wires

๐Ÿ”Œ Wiring Diagram

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_PULLUP resistors, so no external resistors are required for the buttons!

๐Ÿ”Š Sound Effects

  • 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.

๐Ÿš€ Installation

  1. Download the Arduino-Minesweeper.ino file.
  2. Open it in the Arduino IDE.
  3. Select your board (Arduino Uno).
  4. Click Upload.
  5. Open the Serial Monitor (9600 Baud) to see the game status and admin debug messages!

๐Ÿ“œ Code Logic Features

  • Anti-Ghosting: Includes a 50ms software debounce to filter electrical noise.
  • Mechanical Stability: Includes a waitForHardwareReset function 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.

About

A physical Minesweeper game built with an Arduino Uno, 7 tactile buttons, and a piezo buzzer. Features software-based debounce shielding, mechanical state validation on startup, and dynamic audio feedback.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages