Whac-a-mole is a reaction time game where players try to cover a photoresistor as soon as they see the corresponding LED illuminate. Miss three LEDs and the game is over! Good luck...

Inspiration

Our game is based on the classic Whac-a-mole game but with an added IOT component!

What it does

Whac-a-mole displays a random LED and requires the player to click the corresponding timer before it's too late! Wait too long, and the game is over. Rounds start off slow but gradually increase in difficulty as the allowed reaction time is decreased. The current and high school is displayed through the blynk interface and an RFID tag is required to initialize the game each time. Blyk also can control turn on and off the game completely through an on/off switch.

How we built it

To build the Whac-a-mole, we connected a series of buttons to be input pins to our Arduino and the same number of LEDS to output pins. Two separate indicator LEDS were set up to light up when Blynk had turned the game on, and another LED when the RFID tag was accepted to start a new game. Because of the limited number of pins, a separate Arduino was used to connect the RFID scanner.

Challenges we ran into

We initially struggled with the hardware for our game as we had planned to incorporate photoresistors as the method for hitting the mole. For example, if a specific LED is illuminated, you would cover the corresponding photoresistor as fast as possible. Unfortunately, not only was this function difficult to integrate into existing code online, but the photoresistors were largely unreliable.

The final major issue we faced was with coding the game mechanics and making it interact correctly with the IOT components of our game. Initially, the example code we found online almost worked but it was not ideal for the game mechanics we initially had in mind. In the end, after many hours of fiddling with existing code, we had to write the code from scratch.

What we learned

We learned a lot about Wifi connectivity and which hardware works best. This was our biggest stumbling block and where we spent a lot of time problem-solving.

Accomplishments that we're proud of

We were especially proud of our incorporation of the Blynk interface into the game. The game is not only controlled via Blynk, but also current and high score is displayed there as well.

Hardware

Arduino Uno / Arduino MKR WiFi 1010

Software

Link to our code: https://drive.google.com/file/d/12saaLkd6OI69GX62Y8Ct-kP2bqqdqB9p/view?usp=sharing

What's next for Whac-a-mole

Ideally, we would like to rework our hardware not use two different controllers. Also, we would like to package our game in a neat acrylic controller box to make it more enjoyable to play.

Built With

Share this project:

Updates