Button Masher

This simple game emulates the “button mashing” mechanic seen in many of my favorite video games. My goal with the design was to make a visual scale that establishes a range of scores to encourage competition and keep the player engaged, while maintaining the overall clean and tidy look!

Overview:

After a quick countdown, the green light flashes and you’re on! Press the button as many times as you can in 10 seconds! Once the time is up, the amount of presses will correspond to a score ranging from “Try again” (0-40 presses) to “Legendary” (90-100 presses).

Under the hood:

The LED sequence is timed using digital pin outputs from the microcontroller and my uploaded Python code. Once this sequence has finished, the button counter is live. I used a debounce delay to ensure that the number of presses was accurately counted.

After the presses are calculated and logged, the stepper motor turns as a function of the number of times the button was pressed, 0-180 degrees, 0-100 steps, 0-100 button presses during the time frame. The scale was determined through some playtesting; I couldn’t find anyone who was able to get higher than 96!

Wiring and Coding

Here you can see my early workings of the game, before the final shell was added to give it the look I wanted. You can see the H-Bridge in red, which gives the motor the ability to spin in two directions by changing the direction of current flow through the motor — something that is necessary for a stepper motor to work.

You can also see my terminal printing exactly how many button presses occurred at the end, which correlates to the angle of turn of the motor.

The stepper motor was the right choice for me because I wanted consistent scoring — only a stepper motor can turn a consistent number of “steps” and backtrack the same amount.

Machining the Box

This is the box layout I created in SOLIDWORKS, which I customized to fit the specifications of the stepper motor (to mount) as well as the space constraints of my wiring (it was a close one!).

Prior to this project, I had laser cut on a different machine with acrylic, but this was the first time working with birch.

I made sure to keep the top part of the box unsecured, so that I could access the wiring when I needed to troubleshoot .

Skills & Knowledge Developed

〰️

Skills & Knowledge Developed 〰️

  • Wiring with KB2040

  • H-bridge usage

  • Stepper motor usage + troubleshooting + step sequences

  • Laser cutting birch

  • Soldering

  • 3D printing

  • Python

  • SOLIDWORKS to make DXF

Previous
Previous

Hot Rod - Internet-Controlled Robot

Next
Next

Peltier Cooling Belt