Files
lcd1602atest/README.md
DESKTOP-PUHFO60\dsx2016 8ad00d8718 Fix LCD1602 blank display: HD44780 timing, pinmap switch, contrast hint.
Match LiquidCrystal_I2C init delays; add Map button for alternate PCF8574 wiring; warn about blue contrast pot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-23 14:30:21 +08:00

59 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.
# LCD1602A 液晶(CYD)
触控 + LVGL 参考 `tftest` / `hw269test` / `hw069digitdisplaytest`。
LCD1602A(HD44780)经 **PCF8574 I2C 转接板** 驱动:改两行文字、清屏、背光。
## 硬件
| 项目 | 说明 |
|------|------|
| 板子 | CYD ESP32-2432S028R |
| 模块 | LCD1602A + I2C 背包(PCF8574,常见地址 **0x27 / 0x3F**) |
| SDA | **GPIO22** |
| SCL | **GPIO27** |
接线:
| LCD1602A(I2C) | CYD |
|---------------|-----|
| VCC | **5V**(屏对比度更稳;多数模块也可试 3.3V) |
| GND | GND |
| SDA | GPIO22 |
| SCL | GPIO27 |
上电会扫描 `0x27 / 0x3F / 0x26 / 0x3E` 等。串口与 TFT 状态栏会显示是否找到地址。
### 背光有、字没有?
1. **先拧 I2C 转接板上的蓝色电位器(对比度)**——这是最常见原因;背光晶体管和字符是两回事。
2. 供电优先接 **5V**(不是 3.3V)。
3. 仍无字:点 TFT 上 **Map** 切换另一种 PCF8574 脚位映射后再试 **Hello**。
## 操作
- 中间两行:当前 LCD 内容预览(16 字符/行)
- **Demo**:循环示例文案
- **Hello**:`Hello World!` / `LCD1602A`
- **Map**:切换 I2C 背包脚位映射并重新初始化
- **BL ON/OFF**:背光开关
## 构建 / 烧录
```powershell
pio run -e cyd -t upload
```
## 预编译固件
```powershell
cd firmware\cyd
.\flash.ps1
# 或 .\flash.ps1 -Port COMx
```
重新导出:
```powershell
.\firmware\export_from_build.ps1
```