Mbed DDR

Overview

The objective of this project is to create a game on the mbed similar to the popular Dance Dance Revolution series. The MPR121 Capacitive Keypad serves as the input while the sound is being played on a different mbed. Unlike the Dance Dance Revolution games, the music does not have a specific arrow pattern as the program pseudo-randomly creates arrows during the game.

Note

We chose to use a second mbed to read from an SD card and play the .wav file from it due to performance dropping on the primary mbed when too many processes were running on it. A possible experiment is to use a .mp3 codec to play a music file instead.

Wiring

/media/uploads/jmelliadis3/photo.jpg

Primary Mbed

Mbed PinMPR121 Keypad
GNDGND
P9SDA
P10SCL
P26IRQ
VOut(3.3V)VCC

Note

In our setup, we used two 4.7 kilo-ohms resistors to pull up SDA and SCL since we did not have the breakout board for the MPR121 Capacitive Keypad.

Mbed PinuLCD(with cable)uLCD(without cable)
Vu(5V)+5V+5V
P27(RX)RXTX
P28(TX)TXRX
GndGndGnd
P29RESRES

Secondary Mbed

Mbed PinSD Card ReaderAmplifier
P5D1
P6D0
P7SCK
P8CS
P29Base(B)
Vout (3.3v)VCC
GNDGND

Interconnections between Mbeds

Primary MbedSecondary Mbed
P21 (start)P26
P22 (stop)P25
P23 (songOver)P30

Program

The game begins at a start screen where a user can choose a difficulty. Currently there are 3 difficulties: easy, medium, and hard. After the game begins, there is a counter on the top right that corresponds to how many mistakes a user is allowed before game over. The counter initializes to 15 and decrements when a user misses an arrow, presses the wrong button, or presses the right button too early. The counter increments for every correct user input. The number of arrows hit correctly is shown in the top left corner of the screen.

MPR121 KeyGame Input
0Up arrow
4Left arrow
6Right arrow
9Down arrow
5Start button
3Select Easy mode
7Select Medium mode
11Select Hard mode

Main Program for Game

To be loaded on the primary Mbed.

Import programmbedDDR

1st half of mbed DDR game

Program for .wav Player

To be loaded on the secondary Mbed.

Import programMbedDDRSound

2nd half of mbed DDR

Demo

The video below shows a demo of the program.

Further Experimentation

  • Create specific arrow sequences for different songs
  • Using an .mp3 codec or other item to play music, possibly through the primary mbed
  • Multiplayer functionality by adding another capacitive touchpad
  • Adding song choice to the start menu in addition to difficulty


Please log in to post comments.