Files
tftest/README.md
DESKTOP-PUHFO60\dsx2016 a7a7685fc9 Add touch buttons for speaker toggle and music playback.
Enable SoftSPI touch, replace auto beeps with Speaker ON/OFF and Play Music controls, and document usage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-17 17:36:54 +08:00

52 lines
1.4 KiB
Markdown
Raw 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.
# CYD TF 卡信息 + 触屏扬声器(LVGL)
在 **ESP32-2432S028(CYD)** 上:
- 挂载 TF/microSD,LVGL 显示卡信息
- **触屏按钮**开关扬声器、播放内置音乐
## 硬件
| 功能 | GPIO |
|------|------|
| TFT MOSI / MISO / SCLK | 13 / 12 / 14 |
| TFT CS / DC / BL | 15 / 2 / 21 |
| **SD MOSI / MISO / SCK / CS** | **23 / 19 / 18 / 5** |
| **Speaker(SC8002B → P4)** | **26** |
| **Touch MOSI / MISO / CLK / CS / IRQ** | **32 / 39 / 25 / 33 / 36** |
触摸使用 SoftSPI bitbang,不占用 VSPI,可与 SD 同时工作。喇叭接 **SPEAK / P4**。
## 触屏操作
| 按钮 | 作用 |
|------|------|
| **Speaker ON / OFF** | 打开/关闭扬声器(关=静音并停止播放) |
| **Play Music / Stop** | 播放内置旋律《小星星》;播放中变为 Stop |
建议顺序:先点 **Speaker ON**(会有短提示音)→ 再点 **Play Music**。
## 屏幕信息
- Status / Type / Format / Capacity(TF)
- Audio:当前音频状态
- 用量进度条
## 编译烧录
```bash
pio run -t upload
pio device monitor
```
## 注意事项
- TF 需 **FAT/FAT32**。
- 若触屏坐标偏移,改 `src/touch.cpp` 里 `map(...)` 校准范围。
- 若点按无反应,检查排线/旋转;可尝试交换 raw_x/raw_y 映射。
- 变更请更新 `CHANGELOG.md` 并提交本地 git。
## 版本
见 [CHANGELOG.md](CHANGELOG.md)。