Flappy Bird on ESP8266

More details below –
Flappy Bird is a popular phone/tablet game.
Themis Benetatos wrote a version for the Arduino microcontroller and this is my porting of that code to the ESP8266.

Several changes had to be made, even though the ESP8266 can use the Arduino IDE development environment. Most importantly, the ESP would crash due to loop waits. The Watchdog timer is therefore reset within the code.
Sound has been added, with output on Pin 12 to a small speaker – unamplified works fine with ex tablet type speakers.
A ‘Winner’ section has been added. The goal is to reach 25 points.

Any ESP8266 with enough pin outputs to drive the screen, speaker and a play button will work, for example ESP-12, 12E, 03, 07.
The screen here is a Sainsmart ST7735 1.44″ TFT, the 1.8″ version will also work.

Here’s the download link to the game:
https://www.dropbox.com/s/l17l4khjyve4rxl/FlappyBirdESP8266.ino?dl=0

Original game, by Themis Benetatos:

His video shows the gameplay graphics much better 🙂

Connections:
ESP8266
GPIO 15…2.2K..GND
EN………….wire…VCC
RX0……….TX of FTDI programmer
TX0……….RX of FTDI programmer
GPIO 0….2.2K…VCC – wire GPIO 0 to GND to uplooad
GPIO 2….2.2K…VCC
GPIO 2….button switch…other side of switch to GND

ESP8266………..ST7735 TFT
VCC………………..VCC
GND……………….GND
GPIO15………….CS
RST………………..RESET
GPIO5……………A0
GPIO13………….SDA
GPIO15………….SCK
VCC..220ohm..LED

GPIO12…………Speaker
GND………………Speaker GND

You may also like...