# esp32-CYD

> Cycles the full screen of an ESP32-2432S028 (Cheap Yellow Display, ST7789 variant) through ten colors, one per second, using LovyanGFX with all pin configuration defined directly in the sketch.

- Author: Mikrobot.pl
- Platform: ESP32
- Board: ESP32 Dev Module (`esp32:esp32:esp32`)
- SDK version: 3.3.6
- Tags: #esp32, #cyd, #display, #lvgl
- Created: 2026-08-26
- Updated: 2026-11-12
- Favorites: 1, forks: 0
- Project page (view, flash from the browser, fork): https://flashesp.com/explore/Wq6hrsOjLh7Zy2XsGS26Y
- Download all sources (zip): https://flashesp.com/api/public-projects/Wq6hrsOjLh7Zy2XsGS26Y/download-sources/

## Source files

- [libraries_lock.json (154 B)](https://flashesp.com/explore/Wq6hrsOjLh7Zy2XsGS26Y/files/Dpr3C4kaybDrOwkCpLF8K.md)
- [main.ino (2.4 KB)](https://flashesp.com/explore/Wq6hrsOjLh7Zy2XsGS26Y/files/970IFFiXkHg78GmsTM1RC.md)
- readme.md (1.7 KB)

## README

# 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.
