Introduction: Whac-A-Button With Arduino
Whac-A-Mole like game with Arduino and Arcade style LED buttons.
This is a very simple version of the Whac-a-mole game, where a button lights up and waits for the player to hit it. If the correct button is hit the score is updated and a new button lights up. The player is not punished if they hit the wrong button. Only one button lights up at a time. Time to hit the button reduces each game cycle.
Step 1: Display
Start by adding the display and secure it with two M3 screws.
Step 2: Buttons
Add the buttons and keep them in the same orientation - it will make wiring easier.
Step 3: Wiring
Connect all grounds together. Using a daisy chain makes everything easier.
Connect the rest of the pins, I'm using crimp connector to 2 pin JST.
Step 5: Connect the Display
Display – Arduino
CLK – Pin 8
DIO – Pin 7
GND – GND
5V – 5V
Step 6: Connect All LEDs and Buttons to the Arduino Pins
LED1 – Pin9
LED2 – Pin10
LED3 – Pin11
LED4 – Pin12
LED5 – Pin12
Button1 – Pin2
Button2 – Pin3
Button3 – Pin4
Button4 – Pin5
Button5 – Pin6
If you've used the green button for LED1 also use it for Buttons1.
Assemble the rest of the panels. Keep the right panel last as that's where the usb cable will come out.
Step 8: Files
Download the whack_a_button_arduino.dxf file it's in millimetres.
Step 9: Code
Get the code from GitHub - whack_a_button
At start the game will be in waiting for input where all LEDs will be flashing until one of the buttons is pressed and that’s when the game will start. After the game ends it will return to the waiting for input state while still showing the latest score and it will stay like that until a button is pressed and new game starts.