For this project, my team decided to create a hat-shaped controller to play an emulated version of the original Mario Bros. game on PC.
The hat controller works by tilting it to either right or left to make Mario move in that direction, then pressing the "blue" aluminum button (the one where your thumb is) on the secondary control you can make Mario jump, pressing the "red" (the one where the index finger is) will fire the fireball if you have the power, and pressing the one on top pauses the game.
For creating the project we needed a hat, so we decided to go for a cowboy hat, it looks cooler and the cardboard color goes better with it than a regular cap would. To make it first we needed to glue 2 cardboards together to have an acceptable size, then we just cut it into a circle and cut another circle in the middle. Using other cardboard we made the crown, we just had to attach to the piece we cut before and adjust it to fit. Since we used the piece to shape the crown it fitted perfectly in the larger circle, we used some tape to attach both parts. Afterward, we just added some more tape as decoration and folded two sides to give it some curvature. Then we just attached the CPX on the top of the crown, making sure the position was correct and that the tilting direction would match Mario's movements.
The trigger was easier, we just made a small area to house the CPX and shaped it to be held comfortably, then we attached three bottle caps of different sizes covered in aluminum which was later connected to the CPX via alligator clips. We also made a hole for the USB to come out.
The coding consists of triggering certain keys in the keyboard when some action takes place, tilting right and left will trigger A and D respectively, and touching the button on the front triggers K and the one on the rear J, which are the Jump and Fireball keys respectively. Finally using the button on top will trigger G which pauses and unpauses the game. All of this is shown in the video above. We got some ideas for the coding from Adafruit tutorials and other posts on Hackster.











Comments