ECE 4180 Lab 4 Racing Game
Components used:
-Thumb Joystick
-SD Card Reader
-Class D Amplifier
-Speaker
-uLCD
We created a racing car game with the LCD display, Class D Speaker, SD card reader, and thumb joystick.
Thumb Joystick
Joystick | mbed |
---|---|
VCC | p 40 - Vout |
VERT | p 15 |
HORZ | p 16 |
SEL | not using |
GND | p 1 - GND |
SD Card Reader
The following table is the pin diagram for the SD card Reader
MicroSD Breakout | Mbed |
---|---|
CS | 8 (DigitalOut cs) |
DI | 5 (SPI mosi) |
VCC | VOUT |
SCK | 7 (SPI sclk) |
GND | GND |
DO | 6 (SPI miso) |
CD | Not connect |
For more reference please visit this page:
https://developer.mbed.org/cookbook/SD-Card-File-System
Class D Speaker
Following is the pin diagram for the Class D Speaker
mbed | TPA2005D1 | Speaker |
---|---|---|
gnd | pwr - (gnd), in - | |
Vout (3.3V) or 5V | pwr + | |
p26 (any PWM or D/A) | in + | |
out + | + | |
out - | - | |
Any DigitalOut px(optional) | S (low for shutdown) |
For more reference please visit this page:
https://developer.mbed.org/users/4180_1/notebook/using-a-speaker-for-audio-output/
uLCD
Following is the pin diagram for the uLCD display:
mbed | uLCD Header | uLCD cable |
---|---|---|
5V=VU | 5V | 5Vv |
Gnd | Gnd | Gnd |
TX=P13 | RX | TX |
RX=P14 | TX | RX |
P11 | Reset | Reset |
For more references of the LCD please visit this page:
https://developer.mbed.org/users/4180_1/notebook/ulcd-144-g2-128-by-128-color-lcd/
Code for the Racing Car Project
Import programECE4180Lab4
ECE 4180 Lab 4 Racing Game
Video Demo
In this video, we ran the project showing both the victory and defeat conditions.
Please log in to post comments.