Add KY-009 RGB LED test with SoftSPI touch and LVGL.

R/G/B color switch (GPIO22/27/4), PWM brightness, and flashable firmware/cyd package.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-23 11:17:31 +08:00
commit 53c57f1cfd
23 changed files with 1958 additions and 0 deletions

43
README.md Normal file
View File

@@ -0,0 +1,43 @@
# KY-009 SMD LED(CYD)
触控 + LVGL 参考 `hw269test` / `tftest`。一次只亮一路颜色,可切换 R/G/B + 调亮度。
## 硬件
| 项目 | 说明 |
|------|------|
| 板子 | CYD ESP32-2432S028R |
| 模块 | KY-009 SMD RGB LED |
| R | **GPIO22** |
| G | **GPIO27** |
| B | **GPIO4**(未接则蓝灯无输出) |
接线:`R→GPIO22`,`G→GPIO27`,`B→GPIO4`,`GND→GND`(共阴);若共阳需改 duty 极性。
## 操作
- **R / G / B** 按钮:切换当前颜色(其它路关断)
- 滑条:当前颜色亮度 0–100%
- 底部按钮:总开关
## 构建 / 上传
```bash
pio run -e cyd -t upload
```
## 预编译固件
随时可刷(无需编译):
```powershell
cd firmware\cyd
.\flash.ps1
# 或 .\flash.ps1 -Port COM3
```
重新从构建导出:
```powershell
.\firmware\export_from_build.ps1
```