An Arduino sketch that renders a bouncing, spinning Boing Ball animation on an ESP32-driven TFT display. The animation is drawn directly with TFT_eSPI, using an off-screen sprite for smoother frame updates, simple gravity, wall bounces, shading, and a floor shadow.
Features
- Red-and-white checker Boing Ball rendered as a shaded sphere
- Smooth animation using a
TFT_eSpriteframe buffer - Basic gravity, bounce physics, horizontal movement, and spin
- Dynamic shadow that changes as the ball moves
- Backlight control through a configurable GPIO pin
Hardware
This sketch is intended for an ESP32 board connected to a TFT display supported by the TFT_eSPI library.
The current sketch enables the display backlight on GPIO 4:
const int TFT_BACKLIGHT_PIN = 4;
Change that value in ESPBoingBall.ino if your board uses a different backlight pin, or remove the backlight setup if your display handles it separately.
Requirements
- Arduino IDE or Arduino CLI
- ESP32 board support installed
TFT_eSPIlibrary installed- A configured
TFT_eSPIsetup file for your display controller, resolution, and pins
Getting Started
- Clone or download this repository.
- Open
ESPBoingBall.inoin the Arduino IDE. - Install the
TFT_eSPIlibrary if it is not already installed. - Configure
TFT_eSPIfor your specific ESP32 and TFT display. - Select your ESP32 board and port.
- Upload the sketch.