What is it?
SquareGame is a whack-a-mole type game, using an Arduino, an Adafruit Trellis I2C keypad, and other various bits of hardware.
I'd been curious for a while about experimenting with the Arduino, but couldn't find the time to mess around with it, until recently. Wish I had't waited so long, it's really fun. Downright easy for someone with an Engineering background like mine to put together some interesting things. Anyway, the Trellis keypad inspired me to make something interactive, and this whack-a-mole game is the outcome.
Current Status:
The game works!
I soldered up the Trellis with all white LEDs and some wires:
I printed out a pattern which lays out where to mark and drill holes on the project box, and glued it to the project box with glue stick:
Then I marked the holes:
Drilled the holes:
...and cut out the square holes for the buttons using a Dremel rotary tool and a utility knife:
Buttons in place:
Underside. Little scraps of wood to brace the Trellis's PCB so that pushing the buttons hard doesn't break it out:
The game starts with a "get ready get set go" display and musical notes. Game play currently ends with either 11 successful "hits" or 11 misses, whichever comes first. (If the player does nothing, it will go on forever; this needs to be changed.) Sounds that correspond to a hit or miss. If the player wins, happy music plays; if the player loses, sad music. And back around to the beginning again.
There are two modes, Hard, which even I sometimes don't win at, and Easy, which is just difficult enough to be a minor (but not overly frustrating) challenge to a 6 year old. I did some usability testing:
As you can see, in the photo above, it wasn't yet in the project box, and was using an Arduino Uno for development/prototyping purposes.
Eventually I got it all soldered up with the Arduino Pro Trinket.
About to drill the holes for the speaker on the bottom cover.
Drilling the holes for the speaker on the bottom cover.
All assembled
All assembled, and ON!
TODO:
Add another difficulty mode.Encapsulate the difficulty logic for choosing the next LED lit and duration and all that in a class.Add code to make the celebration for a win a little more exciting. There's a ton of unused digital output pins that I could simply wire up to LEDs, mounted to the outside of the project box, to blink upon a win. I added the LEDs and have begun writing the code to make winning more exciting by making the LEDs flash etc.Put everything in the project box. This means getting out the drill press and making some precision holes in the project box...Also, paint the project box something other than the gloss black it came in. (Though now that this is thoroughly assembled, this is not too likely to actually happen.)Get the game working on the Adafruit Pro Trinket, rather than the Arduino Uno board I'm using to prototype on. This will be easy enough, but I need to get around to it.
How it Works, etc.:
SquareGame source code is found on my GitHub.
SquareGame relies on my Arduino libraries MelodyPlayer and Sparkle, both also on GitHub.
Selected hardware:
- Adafruit Trellis I2C keypad
- project box
- Adafruit Pro Trinket
- Various LEDs, wires, switches and hardware
...Back to Thad's Other Projects
03/05/17 © 2017 Thad Jaszek