Inspiration

We've been using the Papilio DUO board in class for a long time, and wanted to test its capabilities outside of the classroom by making something fun. The Spartan6 FPGA on the board is what we've been using in class, but we wanted to try using the ATmega32u4 processor that is also on the board.

What it does

Upon programming the board, the first 5-bit sequence is shown on the five left-most LEDs, and then the sequence disappears after a short period of time. The player must then enter that sequence on the five right-most switches. After inputting what the user thinks is the right sequence, the user must press the right push-button to confirm their guess. If the user was correct, then 5 LEDs light up before the next sequence is shown. If the user was wrong, then the LEDs blink rapidly, indicating that the player has lost. At that point, the user may press the left push-button to start the game again.

How we built it

We used the C language and Atmel Studio IDE, as well as the automated script to program the ATmega32u4 found at http://watsonwiki.binghamton.edu/index.php/Papilio_Duo

Challenges we ran into

We ran into challenges when trying to use the rand() function in C to generate a random sequence of 5 bits. For some reason, it always gave us 31. We also ran into challenges when trying to configure the up push-button on the Papilio, as well as when creating blocking and non-blocking functions for interfacing the other push-buttons.

Accomplishments that we're proud of

Making a fun game that works!

What we learned

The ATmega32u4 processor on Papilio DUO cannot interface with 3 of 8 LEDs and 3 of 8 switches on the Papilio LogicStart Shield that we used.

What's next for Defuse the Bomb! (Game)

Randomization of bit sequences, adjustable speed, gain access to Papilio FPGA to turn on all the LEDs and switches (would need to use VHDL), include a time limit for inputting the sequence

Built With

  • c
  • papilio
Share this project:

Updates