Doodle Jump for mbed with IMU control
Overview
For our project, we made a simplified version of the game Doodle Jump using a uLCD-144-G2, a LSM9DS1 IMU, a speaker with a Class D high-efficiency audio amplifier, and an SD card reader. An external 5V power supply was used along with the mbed 3.3V in order to sufficiently power all the devices. When the mbed powers on, the IMU initializes and then the game gives a 3 second count down before starting. The player tilts the device left or right in order to control the direction of the in-game character. The character must jump on platforms in order to progress and gain points for its score. if the character reaches the bottom of the screen, the game is over.
The character is a 9x10 pixel image located in the sd card. The mbed takes the picture and draws it onto the screen. Sound is played on every successful platform jump, and a losing song is played at the end when the player loses.
Components
Circuit
uLCD
mbed | uLCD Header |
---|---|
5V = External 5V | 5V |
Gnd | Gnd |
TX = P28 | RX |
RX= P27 | TX |
P30 | Reset |
I2C
mbed | LSM9DS1 |
---|---|
VOUT | VDD |
Gnd | Gnd |
P9 | SDA |
P10 | SCL |
Amplifier and Speaker
mbed | amplifier | Speaker |
---|---|---|
Gnd | pwr - (gnd), in - | |
5V = Extermal 5V | pwr + | |
p18(any PWM or D/A) | in+ | |
out+ | + | |
out- | - |
SD Card reader
mbed | SD Card reader |
---|---|
VOUT | VCC |
Gnd | Gnd |
p8 | CS |
p7 | SCK |
p6 | DO |
p5 | DI |
Program
Import programmbed_4180_lab4
Simplified Doodle Jump game for mbed
Files for SD Card: /media/uploads/bhill42/doodlejumpfiles.zip
Please log in to post comments.