Add 3-pin whistle sound sensor digital H/L detect on GPIO22.
Touch+LVGL UI shows QUIET/SOUND, pin level, hit count; no dB (digital only). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
35
README.md
Normal file
35
README.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# 口哨 / 声音传感器(CYD)
|
||||
|
||||
触控 + LVGL 参考 `activeBuzzerTest` / `hw269test`。三针口哨模块 **高低电平** 接 **GPIO22**:有声触发显示、累计 hits。
|
||||
|
||||
## 硬件
|
||||
|
||||
| 项目 | 说明 |
|
||||
|------|------|
|
||||
| 板子 | CYD ESP32-2432S028R |
|
||||
| 模块 | 三针口哨/声音传感器(黑头麦克风,OUT 高低电平) |
|
||||
| 信号 | **GPIO22** |
|
||||
|
||||
接线:`VCC→3.3V`(或模块标注电压),`GND→GND`,`OUT / DO / S→GPIO22`。
|
||||
|
||||
默认按 **高电平 = 有声**。若实际相反,改 `include/pins.h` 里 `SOUND_ACTIVE_HIGH` 为 `0`。板上电位器可调灵敏度。
|
||||
|
||||
## 功能
|
||||
|
||||
- 实时显示 QUIET / SOUND!、引脚 HIGH/LOW
|
||||
- 边沿计数 hits(带消抖);触控 **Reset** 清零
|
||||
- **无分贝**:本模块只有数字口,GPIO22 也非 ADC,无法测 dB
|
||||
|
||||
## 构建 / 烧录
|
||||
|
||||
```bash
|
||||
pio run -e cyd -t upload
|
||||
```
|
||||
|
||||
或预编译包:
|
||||
|
||||
```powershell
|
||||
cd firmware\cyd
|
||||
.\flash.ps1
|
||||
# 或 .\flash.ps1 -Port COMx
|
||||
```
|
||||
Reference in New Issue
Block a user