This repository contains a public test sketch for the ESP32-C3FH4-RGB board with its built-in 5x5 NeoPixel-compatible RGB matrix. You can clone it, build it with PlatformIO, and flash it directly to a compatible board.
The sketch is designed as a compact demo project: it boots with a short countdown, then rotates through multiple visual effects on the matrix.
- Arduino-based sketch for the ESP32-C3FH4-RGB
- PlatformIO project ready for VS Code
- 5x5 RGB matrix animation engine with scene rotation
- built-in startup countdown:
3,2,1 - eight included effects with no extra assets required
- simple orientation handling through a single pixel mapping function
The current code targets the ESP32-C3FH4-RGB board and is configured as follows:
- Board:
ESP32-C3FH4-RGB - MCU:
ESP32-C3FH4 - PlatformIO board profile:
esp32-c3-devkitm-1 - Framework: Arduino
- LED count:
25 - Matrix data pin:
GPIO 8 - Status LED pin:
GPIO 10 - Pixel format:
GRB,800 KHz - Default brightness:
48 - Serial monitor speed:
115200
PlatformIO uses the generic esp32-c3-devkitm-1 target here because it is compatible with this sketch setup.
If your board uses different pins, LED order, or matrix orientation, adjust the constants and mapping logic in src/main.cpp.
The active effect order is defined in kAnimations[] in src/main.cpp.
| Effect | Description |
|---|---|
ConfettiBurst |
Random sparkles and short color bursts across the matrix |
TetrisFall |
Mini falling tetromino simulation on a 5x5 playfield |
Matrix |
Vertical falling drops with colored tails |
Heartbeat |
Pulsing heart rendered from a 5x5 mask |
RainbowWave |
Moving rainbow wave with a brighter band |
SpectrumCycle |
Smooth hue gradient cycling across the display |
SnakeCascade |
Color-changing snake moving through the full matrix path |
PlasmaBloom |
Abstract plasma-style animated color field |
On boot, the sketch:
- initializes the LED matrix and serial interface,
- renders a short
3,2,1countdown, - starts the first enabled animation,
- automatically rotates through all enabled scenes.
- platformio.ini PlatformIO environment definition for the ESP32-C3 target.
- src/main.cpp Complete sketch source, animation engine, LED mapping, and effect implementations.
- LICENSE License for the original code in this repository.
- THIRD_PARTY_NOTICES.md Third-party dependency and license references.
This project is intended for PlatformIO in VS Code.
- Install Visual Studio Code.
- Install the PlatformIO IDE extension.
- Open this repository as a folder in VS Code.
- Connect your ESP32-C3 board over USB.
- Build the project.
- Upload the firmware.
- Open the serial monitor at
115200baud if needed.
The serial port is not hardcoded in platformio.ini, so PlatformIO can auto-detect it. If auto-detection does not work on your machine, set the upload and monitor port locally in your own PlatformIO configuration.
The most useful constants to tweak are in src/main.cpp:
kBrightnesskConfettiFrameDelayMskTetrisFrameDelayMskMatrixFrameDelayMskMaxFallingPieceskSpawnChancePercent
To change matrix orientation, update xyToIndex() in src/main.cpp. The current mapping applies a 180-degree rotation relative to the animation logic.
To add a new effect:
- add a new entry to
AnimationId, - add an item to
kAnimations[], - add any required state,
- initialize it in
initAnimation(), - update it in
updateAnimation().
This project relies on the following external software:
- Adafruit NeoPixel library, resolved by PlatformIO from
adafruit/Adafruit NeoPixel @ ^1.12.5 - Arduino framework for ESP32, installed through the
espressif32PlatformIO platform
See THIRD_PARTY_NOTICES.md for upstream project links and license notes.
The original code in this repository is licensed under the MIT License. See LICENSE.
Third-party libraries and frameworks are distributed under their own licenses and are not relicensed by this repository.
This is a small public test sketch intended for experimentation on compatible ESP32-C3 LED matrix boards. Flash and use it at your own risk, and always confirm the GPIO wiring and power requirements of your specific hardware before uploading.
This repository uses the Adafruit NeoPixel library for LED output and the Arduino framework for ESP32 through PlatformIO. Full upstream references are listed in THIRD_PARTY_NOTICES.md.