Docs: expand README (wiring, UI layout, changelog) and refresh firmware meta.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-23 13:51:29 +08:00
parent e4031865bc
commit 0ac35871dc
3 changed files with 53 additions and 16 deletions

View File

@@ -1,35 +1,69 @@
# 口哨 / 声音传感器(CYD)
触控 + LVGL 参考 `activeBuzzerTest` / `hw269test`。三针口哨模块 **高低电平** 接 **GPIO22**:有声触发显示、累计 hits。
ESP32 Cheap Yellow Display(ESP32-2432S028R)+ 三针口哨模块(高低电平)+ LVGL。
触控 + LVGL 壳参考 `activeBuzzerTest` / `hw269test`(SoftSPI,勿改 `src/touch.cpp`)。
## 硬件
| 项目 | 说明 |
|------|------|
| 板子 | CYD ESP32-2432S028R |
| 模块 | 三针口哨/声音传感器(黑头麦克风,OUT 高低电平) |
| 板子 | CYD ESP32-2432S028R(2.8" ILI9341,横屏 UI 320×240) |
| 模块 | 三针口哨/声音传感器(顶部黑头麦克风,OUT 高低电平) |
| 信号 | **GPIO22** |
接线:`VCC→3.3V`(或模块标注电压),`GND→GND`,`OUT / DO / S→GPIO22`。
默认按 **高电平 = 有声**。若实际相反,改 `include/pins.h` 里 `SOUND_ACTIVE_HIGH` 为 `0`。板上电位器可调灵敏度。
默认 **高电平 = 有声**。若实际相反,改 `include/pins.h` 里 `SOUND_ACTIVE_HIGH` 为 `0`。板上电位器调节灵敏度。
## 功能
## 功能 / 操作
- 实时显示 QUIET / SOUND!、引脚 HIGH/LOW
- 边沿计数 hits(带消抖);触控 **Reset** 清零
- **无分贝**:本模块只有数字口,GPIO22 也非 ADC,无法测 dB
- 实时显示 **QUIET** / **SOUND!**、引脚 **HIGH/LOW** 与 active/idle
- 触发时进度条闪动;边沿计数 **hits**(约 40ms 消抖)
- 触控底部 **Reset**:清零 hits
- **无分贝**:数字口 + GPIO22 非 ADC,无法测 dB
界面自上而下分区(互不重叠):标题 → 引脚 → 状态 → 电平 → 条 → hits → Reset。
## 构建 / 烧录
依赖 [PlatformIO](https://platformio.org/)。
```bash
pio run -e cyd -t upload
pio device monitor -b 460800
```
或预编译包:
### 预编译固件
```powershell
cd firmware\cyd
.\flash.ps1
# 或 .\flash.ps1 -Port COMx
# 或 .\flash.ps1 -Port COM4
```
源码更新后重新打包:`.\firmware\export_from_build.ps1`。
## 项目结构
```
platformio.ini # env:cyd,TFT_eSPI + lvgl
copy_lv_conf.py
include/
pins.h # SOUND_PIN=22、SOUND_ACTIVE_HIGH
sound.h / touch.h / ui.h / lv_conf.h
src/
main.cpp
sound.cpp # 数字高低电平采样 + 消抖计数
touch.cpp # SoftSPI 触控,勿改
ui.cpp # 横屏状态页
firmware/ # 预编译包 + export_from_build.ps1
README.md
```
## 变更记录
| 日期 | 说明 |
|------|------|
| 2026-10-23 | 初版:三针口哨 GPIO22 高低电平检测、hits、LVGL UI、可刷 `firmware/cyd` |
| 2026-10-23 | 修 UI:Reset 与 hits/提示重叠,改为自上而下固定分区布局 |

View File

@@ -2,15 +2,18 @@
目录:[`cyd/`](cyd/)
板子:**CYD ESP32-2432S028R**(ILI9341)
功能:三针口哨传感器(GPIO22 高低电平)+ SoftSPI 触控 + LVGL
| 项 | 内容 |
|----|------|
| 板子 | CYD ESP32-2432S028R(ILI9341) |
| 功能 | 三针口哨传感器(GPIO22 高低电平)+ SoftSPI 触控 + LVGL |
| 版本 | 见同目录 `VERSION.txt` / `meta.json` |
## 刷写
```powershell
cd firmware\cyd
.\flash.ps1
# 或 .\flash.ps1 -Port COM3
# 或 .\flash.ps1 -Port COM4
```
## 重新打包

View File

@@ -1,7 +1,7 @@
{
"boardId": "esp32-2432s028",
"name": "CYD Whistle Sound Sensor",
"summary": "3-pin whistle/sound module on GPIO22: digital H/L detect + hit count",
"description": "SoftSPI touch + LVGL. OUT->GPIO22 high/low. Default active HIGH. No dB (digital only).",
"tags": ["sound", "whistle", "digital", "gpio22", "touch", "lvgl"]
"summary": "3-pin whistle module on GPIO22: digital H/L detect, hit count, Reset",
"description": "SoftSPI touch + LVGL 320x240. OUT->GPIO22 high/low (default active HIGH). QUIET/SOUND UI, debounced hits, no dB (digital only).",
"tags": ["sound", "whistle", "digital", "gpio22", "touch", "lvgl", "cyd"]
}