Add button counter test on GPIO22 with SoftSPI touch and LVGL.
Each press increments on-screen count; touch Reset clears. Flashable firmware/cyd package. 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 参考 `hw269test` / `tftest`。GPIO22 读按钮:每按一次,屏幕计数 +1。
|
||||
|
||||
## 硬件
|
||||
|
||||
| 项目 | 说明 |
|
||||
|------|------|
|
||||
| 板子 | CYD ESP32-2432S028R |
|
||||
| 模块 | 轻触按钮 / 按键传感器(SIG 输出) |
|
||||
| 信号 | **GPIO22**(内部上拉,按下为 LOW) |
|
||||
|
||||
接线:`VCC→3.3V`,`GND→GND`,`SIG→GPIO22`。
|
||||
|
||||
## 操作
|
||||
|
||||
- 按一下物理按钮:计数 +1
|
||||
- 屏幕显示当前计数与 PRESSED / IDLE
|
||||
- 触控 **Reset**:计数清零
|
||||
|
||||
## 构建
|
||||
|
||||
```bash
|
||||
pio run -e cyd -t upload
|
||||
```
|
||||
|
||||
预编译包:
|
||||
|
||||
```powershell
|
||||
cd firmware\cyd
|
||||
.\flash.ps1
|
||||
# 或 .\flash.ps1 -Port COMx
|
||||
```
|
||||
|
||||
更新预编译包:`.\firmware\export_from_build.ps1`
|
||||
Reference in New Issue
Block a user