ECE 4180 Lab 4 Mini Project: Flappy Bird
Overview
This project is a variation on the flappy bird game, even using the same images for the bird and the pipes. The game is displayed on a µLCD screen and uses a speaker that runs in parallel by using a thread, a navigational switch for controls, and a potentiometer for game settings. The game will start with a title screen that shows the high score, read from a txt file, and tells the player to press fire on the navigational switch to start the game. There is also a short song that will play at initial startup. Once the player presses fire, the game will setup and begin moving the pipes. The objective of the game is to guide the flappy bird through the pipes without hitting them with each successful pass incrementing the score and making a beep. The up and down directions on the navigational switch move the flappy bird as interrupts, so you cannot continuously push a direction. Additionally, the potentiometer can be turned to change the game speed (i.e. the movement speed of the pipes). Once the flappy bird hits a pipe, the game is over and goes to the lose screen, playing an end game song. If a new high score is reached, the player is alerted and the txt file is updated. After waiting a few seconds, the game returns to the start screen.

Demo
Code
Import program4180Lab4
Flappy Bird game on mbed with a micro LCD screen, class D amp, speaker, SD card reader/writer, 5-button navigation switch, and potentiometer speed control
Wiring Guide
Micro LCD
| mbed | Micro LCD |
|---|---|
| p30 | Reset |
| p28 | TX on cable, RX on header |
| p27 | RX on cable, TX on header |
| VU | 5V+ |
| GND | GND |
Class D Amplifier and Speaker
| mbed | Class D Amp | Speaker | External Power Source |
|---|---|---|---|
| p25 | IN+ | ||
| OUT+ | + | ||
| OUT- | - | ||
| PWR+ | 5V | ||
| GND | IN-, PWR- | GND |
SD Card Reader/Writer
| mbed | SD Card Reader/Writer |
|---|---|
| p8 | CS |
| p5 | DI |
| p7 | SCK |
| p6 | DO |
| VOUT | VCC |
| GND | GND |
Navigation Switch
| mbed | Navigation Switch |
|---|---|
| p16 | U |
| p15 | C |
| p14 | L |
| p13 | D |
| p12 | R |
| GND | - |
Potentiometer
| mbed | Potentiometer |
|---|---|
| p20 | Wiper |
| VOUT | Top |
| GND | Bottom |
Please log in to post comments.
