readme.md
Markdown · 54 lines
# ESP32 CYD Color Cycle Test
### Full-screen color test for the Cheap Yellow Display using LovyanGFX
This sketch turns an **ESP32-2432S028 (Sunton "Cheap Yellow Display")** into a simple display tester.
After power-up, the whole screen cycles through **10 colors, one per second**, in an endless loop.
It's a quick way to check that the panel, backlight and color order work correctly.
---
## ⭐ Features
- **Full-screen color cycle**
- Red, green, blue, yellow, cyan, magenta, white, orange, purple, black
- 1-second interval, endless loop
- **Self-contained configuration**
- All pins and panel settings are defined in the sketch itself
- No need to edit any library files (unlike TFT_eSPI)
- Works the same in Arduino IDE and in cloud tools like FlashESP
- **PWM backlight control** at full brightness
---
## 📦 Hardware requirements
- **ESP32-2432S028** (Cheap Yellow Display, 2.8" 240x320)
- USB cable for programming
The sketch is configured for the **ST7789** panel variant (usually the version with two USB ports: micro-USB + USB-C).
Pin configuration used in the code:
| Function | GPIO |
|-----------|------|
| SCLK | 14 |
| MOSI | 13 |
| MISO | 12 |
| DC | 2 |
| CS | 15 |
| Backlight | 21 |
---
## 📚 Library
**LovyanGFX** (by lovyan03).
## 🔧 Troubleshooting
- **Wrong colors (red ↔ blue swapped):** set `cfg.rgb_order = true`.
- **Inverted colors (white shows as black):** set `cfg.invert = true`.
- **Shifted or garbled image:** your board may use an **ILI9341** panel instead. Replace `Panel_ST7789` with `Panel_ILI9341`.
- **Upload fails with "Unable to verify flash chip connection":** lower *Tools → Upload Speed* to 115200 or 460800.