Files
btntest/README.md
DESKTOP-PUHFO60\dsx2016 280c5ea97c Fix tactile switch wiring: GPIO22 to GND, show live pin level.
Clarify 4-pin foot pairing and debounce for bare pushbutton.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-23 12:46:31 +08:00

43 lines
898 B
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)
触控 + LVGL 参考 `hw269test`。GPIO22 读 **轻触带帽开关**:每按一次,屏幕计数 +1。
## 硬件
| 项目 | 说明 |
|------|------|
| 板子 | CYD ESP32-2432S028R |
| 开关 | 轻触开关(带帽),瞬时闭合 |
| 引脚 | **GPIO22** |
### 接线(重要)
```
GPIO22 ── 开关一脚
GND ── 开关另一脚
```
- 不要接 3.3V / VCC
- **四脚轻触**:矩形四脚中,同侧两脚内部常通;要接 **对角** 或 **能通断的一对**,不要接已经常通的那一对
- 固件内部上拉:松开=HIGH,按下=LOW
屏上会显示 `GPIO22: HIGH/LOW`:按下应变为 **LOW**;若一直 HIGH,多半是接线或脚对选错。
## 操作
- 按一下开关:计数 +1
- 触控 **Reset**:清零
## 构建
```bash
pio run -e cyd -t upload
```
预编译:
```powershell
cd firmware\cyd
.\flash.ps1
```