Arduino Nano OLED Flappy
The Flappy Bird Game is a simple interactive game developed using an Arduino Nano and a 128×64 I2C OLED display. The player controls a bird using a push button and tries to pass through the gaps between moving pipes.
The project demonstrates the use of Arduino programming, OLED graphics, push-button input, collision detection, random number generation, and game logic.
Supplies
Deshbot shield
uno nano
Oled display
button (inbuild in Deshbot shield)
Working Principle
The game contains three main elements:
Bird
The bird is displayed as a small circle on the OLED. Gravity continuously pulls the bird downward.
When the player presses the button, the bird receives an upward movement, similar to the original Flappy Bird game.
Pipes
The pipes move from the right side of the OLED toward the left side.
A random gap is created between the upper and lower pipes. The player must control the bird so that it passes through this gap.
Score
Whenever the bird successfully passes a pipe, the score increases by one.
The score is displayed at the top of the OLED.
Game Controls
Push Button:
- Press → Bird moves upward.
- Release → Bird falls because of gravity.
After Game Over:
- Press the button → Game starts again.
Downloads
. Features
- 128×64 OLED graphics
- One-button control
- Moving pipes
- Random pipe gaps
- Gravity-based bird movement
- Collision detection
- Automatic score counting
- Game-over screen
- Restart functionality
Conclusion
The Arduino Nano OLED Flappy Bird Game is a simple but practical embedded-system project. It combines hardware and software to create an interactive game.
Through this project, we learn about Arduino Nano, I2C communication, OLED displays, button input, physics-based movement, collision detection, random numbers, and C++ programming.
The project is inexpensive, easy to build, and can be further developed into a more advanced handheld gaming system.