Project Overview
"Flappy-Core" is a minimalist exploration into Real-Time Display Paging and Iterative Physics Simulation. While alphanumeric LCDs are primarily used for static telemetry, Flappy-Core pushes the boundaries of the HD44780 controller by implementing a high-speed game loop. Using custom Bitmask Character Forensics, the project transforms standard 5x8 pixel cells into a dynamic rendering plane, simulating bird flight physics and obstetric avoidance with deterministic reliability on a low-memory 8-bit architecture.
Technical Deep-Dive
- LCD Frame-Buffer & Bitmask Forensics:
- Custom Character Generation: The HD44780 controller allows for 8 user-defined characters (CGRAM). Flappy-Core utilizes this to create the "Bird" sprite and the partial "Pipe" segments. By dynamically refreshing these 8 slots, the game creates the illusion of smooth vertical movement within a fixed character grid.
- Screen Paging vs. Full-Refresh: To prevent visual flickering (flicker artifacts), the firmware avoids calling
lcd.clear(). Instead, it selectively overwrites only the cells where the bird or pipes have changed position, maintaining high frame-rates and consistent visual contrast.
- Iterative Game-Loop Physics:
- The Gravity Constant ($g$): The bird's vertical position is updated in every loop cycle using a simplified acceleration vector. A tactile button press triggers an upward "Impulse," while a constant downward decrement simulates gravity, requiring the player to modulate their input frequency to maintain steady-state flight.
- Obstacle Collision Diagnostics: The pipes are represented as a scrolling array of bitmasks. Collision is detected through a logical AND operation: if the bird's vertical coordinate intersects with the pipe's height-mask at the same horizontal index, a "Collision Flag" is raised, triggering the game-over state-machine.
- Interrupt-Driven Input Synchronization:
- Debounce-Free Kinetic Sensing: The tactile jump-button is monitored using a high-frequency polling loop or hardware interrupt. This ensures that even the shortest human taps are captured, allowing for the rapid "Flap" response required for professional-level gameplay.
Engineering & Implementation
- HMI Efficiency & Resource Management:
- Memory Footprint: The entire game engine, including visual sprites and physics logic, consumes less than 2KB of SRAM. This high-efficiency engineering proves that engaging HMIs can be built without the need for high-resolution OLEDs or external graphical GPUs.
- Contrast Tuning: Field testing indicates that the "Ghosting" of the bird sprite is highly sensitive to the LCD's $V_{O}$ contrast voltage. Precise calibration of the 10k potentiometer is required to balance the pixel response time against ambient light conditions.
- State-Machine Architecture:
- The code is structured into four distinct states:
START_SCREEN,ACTIVE_FLIGHT,COLLISION_EVENT, andHI_SCORE. Transitioning between these states is handled by categorical logic, ensuring that the game reset is instantaneous and seamless.
- The code is structured into four distinct states:
Conclusion
Flappy-Core demonstrates the power of Creative Embedded Design. By mastering LCD Bitmasking Forensics and Iterative Physics Harmonics, developers can push legacy hardware far beyond its intended purpose, creating addictive, high-speed interactive experiences that prove the enduring utility of the 8-bit Arduino Nano/Uno ecosystem.