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.
5 LED buttons
All required wires, screws and nuts
Laser cut acrylic panels
4 digit 7 Segment display TM1637
DXF files available at Thingiverse
Download the code from GitHub – Whack-a-button
Start by adding the display and buttons. Make sure the display pins are pointing inwards, the colour arrangement of the buttons is up to you.
Use 2 screws to secure the display in place.
Keep all buttons in the same orientation – it will make wiring easier.
Wiring might look messy but it’s very simple.
Connect all grounds together using the daisy chain 2.8mm crimp connectors. Again if all buttons are in the same orientation it will be much easier. The end with a jumper wire connect to the Arduino GND.
Now connect the rest of the pins as shown in the images below:
Display – Arduino
CLK – Pin 8
DIO – Pin 7
GND – GND
5V – 5V
Use jumper wires to connect all LEDs to the Arduino pins.
LED1 – Pin9
LED2 – Pin10
LED3 – Pin11
LED4 – Pin12
LED5 – Pin13
Button1 – Pin2
Button2 – Pin3
Button3 – Pin4
Button4 – Pin5
Button5 – Pin6
Tape the wires together to keep them from disconnecting.
Once everything is connected test if it works before assembling the panels.
Download the code from GitHub – Whack-a-button and upload it to the Arduino.
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.
After you’ve checked that everything is connected correctly assemble the rest of the panels.
Leave the right panel last as that’s where the usb cable will be coming out.
Enjoy your play.