Files
smdky009ledtest/README.md
DESKTOP-PUHFO60\dsx2016 39fa51c48e Fix 3.5 KY-009: backlight GPIO27 and G on GPIO21.
Align cyd_35r with CYD_PROJECT_GUIDE (ST7796/GT911), export flashable firmware/cyd_35r.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-25 11:33:47 +08:00

49 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# KY-009 SMD LED(CYD)
触控 + LVGL 参考 `tftest` / `hw269test`。一次只亮一路颜色,可切换 R/G/B + 调亮度。
> **约定:** [`../CYD_PROJECT_GUIDE.md`](../CYD_PROJECT_GUIDE.md) · 本仓 [`AGENTS.md`](AGENTS.md)
## 硬件
| 项目 | **2.8" · 2432S028R** | **3.5" · 3248S035C** |
|------|----------------------|----------------------|
| 屏 / 触控 | ILI9341 + XPT2046 | ST7796 + GT911 |
| 背光 | GPIO**21** | GPIO**27** |
| KY-009 **R** | **GPIO22** | **GPIO22**(不变) |
| KY-009 **G** | **GPIO27** | **GPIO21**(2.8 的 27→21) |
| KY-009 **B** | GPIO4 | GPIO4 |
| PlatformIO | `-e cyd` | `-e cyd_35r` |
接线(共阴):`R→22`,`G→27(2.8) / 21(3.5)`,`B→4`,`GND→GND`。共阳需改 duty 极性。
**禁止**在 3.5 上把 G 接到 27(那是背光)。
## 操作
- **R / G / B**:切换当前颜色(其它路关断)
- 滑条:当前颜色亮度 0–100%
- 底部:总开关
## 构建 / 上传
```bash
pio run -e cyd -t upload # 2.8"
pio run -e cyd_35r -t upload # 3.5"
```
## 预编译固件
```powershell
cd firmware\cyd # 2.8
# 或 cd firmware\cyd_35r # 3.5
.\flash.ps1
```
重新导出:
```powershell
.\firmware\export_from_build.ps1 # 2.8
.\firmware\export_from_build.ps1 -Env cyd_35r # 3.5
```