During the summer after first year I entered the EngHack Hackathon held at the University of Waterloo with Will Clark, a fellow Mechatronics Engineering student and close friend. Together we built a Simon Says game that can be played between buttons and LEDs on a breadboard and an
iPhone. The user creates a sequence of the four colours using their device (breadboard or phone) which is then sent to
their opponent’s device and played back. If their opponent successfully repeats the sequence, they are prompted to create
their own sequence to send back to the user. After each round the length of the sequence increases until one player
makes a mistake, leaving the other player victorious. After the hackathon we continued working on the project so that
now, at any point during gameplay, the iPhone user can send messages to the breadboard user (which are output in Morse
code via a buzzer and LED) and the breadboard user can send Morse code messages to the iPhone user as well.
The video above provides a fairly detailed explanation of how everything works, here I will only provide a brief synopsis. The LEDs and buttons are connected to an Arduino which displays the sequence the user is to repeat, validates their input and then collects their new sequence. This sequence is converted into a byte array and sent using the serial protocol over a USB cable to a Raspberry Pi. The Arduino code is entirely non-blocking so that we could implement button debouncing and perform other time dependent operations (ie. Morse code output) without interfering with each other.
To manage all the code contributions from the various platforms we implemented Git version control software. This allowed us to push code from any device to a central repository, revert to previous versions of the code if we made mistakes, and create branches off the main repository to test new features and then merge them back to the master branch once complete. We learned a lot about the Git workflow and the Simon Says repository is available for viewing on my Git Hub account if you're interested.