I had originally planned to do this project by myself however, after running into Spencer at the Hack-a-thon we decided that we would work on this project as a team. When I arrived Spencer already had an idea in mind for the game as well as the enclosure. The game is a reaction game in which you press the button corresponding to the light that it is next to and then the light changes. Each time you have less time between presses before you lose the game. The enclosure is a wooden cutting board with the arduino, breadboard and accompanying wires all underneath.
We started with 6 LED’s and 6 buttons on a breadboard and begin to hello world some simple concepts of the game to ensure that all of our hardware was functional.
After some very extensive confusion and using up over half of our time at the Hack-A-Thon we realized that our buttons were not wired up properly, causing them to work just enough to have led us to believe that they were wired correctly. After resolving the hardware errors the implementation of the code was not too complicated. We used an array of binary numbers to represent the different LED’s being lit up and used a random number generator to determine which one is selected at any given time. We didn’t come up with a formal state machine due to our time limitations at the Hack-A-Thon. We had used just 3 states, one for the game starting, one for the game itself, and then one for the losing state. The state that is used to control the game could probably be broken down into it’s own state machine but since our code ran just fine I didn’t see any real need to do that. After we got our code fleshed out we began soldering wires to the buttons and LED’s so we could attach them to our enclosure.
After all the LED’s and Buttons were attached to the enclosure we attached the arduino and breadboard to the underside of the enclosure and rewired it all together.
We added a back panel of scrap wood that we found in the lab to help hold all the wires in and to allow it rest better on a surface. Below is a picture and video of the final product.