Stupid Pet Trick: I box, you box

So I had this grandiose plan for building a boxing trainer. It had different rounds, it had a switch for lefty and righty configuration, it split out random combinations, and then could tell if you entered the combination correctly.

I ran into a lot of bumps along the road of this project. The biggest one was working with the piezos themselves. They are so delicate that the legs broke off nearly right after purchasing them. And soldering those suckers was a pain in the arse! I think half the time I spent on this project was either soldering the peizos or fiddling with them when on of the legs broke off.

I was also nervous about physically building an interface. I was in the shop when I noticed a lot of students using the laser cutter, so I drew up a simple interface reflecting my grand dreams of the project and had it etched on a piece of wood I found in the unclaimed scraps.

I began with a small circuit: 2 analog sensors (what i  had with me at home at the time; pressure sensor and on piezo), and 1 LED. From there I started badding more LEDs: 3 red ones for the rounds and a bigger blue and green ones to represent each punch.

Then i dove straight into the programming logic and things got a little complicated. I found that though i would hit the sensor once I would get several “knocks!” over the threshold I set and Arduino would understand it as 2 punches. To get around this, I delayed the program for one millisecond and that seemed to work.

While I ultimately wanted the arduino to show a random combination of varying lengths for each round, I started out with a fixed combination for each. Then to test if the user inputted the same combinationi used nested if-statements. That didn’t really work.

I met with our instructor Scott during office hours. I wished I was a bit more prepared and organized with specific questions. I felt like i had most of the pieces but things hadn’t really come together. Just talked it out with him was really helpful. His advice: start small, get one thing at time working, then build on top of that.

I took his advise, went home and started over. By starting over I was able to figure out how to save a sequence of punches to an array. And that’s how I ended up with this little, “stupid” application.

You punch a combination and it’ll show it back to you. That’s it. There are still three rounds. Round one will wait until you input 3 punches; round two, 4 punches; and round three 5 punches.

Proudly powered by WordPress
Theme: Esquire by Matthew Buchanan.