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.

/media/uploads/Mpmart08/12834568_10209232525995277_1619207957_n.jpg

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

mbedMicro LCD
p30Reset
p28TX on cable, RX on header
p27RX on cable, TX on header
VU5V+
GNDGND

Class D Amplifier and Speaker

mbedClass D AmpSpeakerExternal Power Source
p25IN+
OUT++
OUT--
PWR+5V
GNDIN-, PWR-GND

SD Card Reader/Writer

mbedSD Card Reader/Writer
p8CS
p5DI
p7SCK
p6DO
VOUTVCC
GNDGND

Navigation Switch

mbedNavigation Switch
p16U
p15C
p14L
p13D
p12R
GND-

Potentiometer

mbedPotentiometer
p20Wiper
VOUTTop
GNDBottom


Please log in to post comments.