Files
gy30test/README.md

68 lines
1.9 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.
# CYD GY30 光照仪表盘
ESP32 Cheap Yellow Display(ESP32-2432S028R)+ GY30(BH1750)+ LVGL 光照仪表盘。
布局与交互参考同目录下的 [temperature](../temperature) / [sgp30test](../sgp30test)。
## 硬件
| 项目 | 说明 |
|------|------|
| 板子 | CYD ESP32-2432S028R(2.8" ILI9341) |
| 传感器 | GY30 / BH1750(光照 lux) |
| SDA | **GPIO22** |
| SCL | **GPIO27** |
| 供电 | USB 5V;传感器接 **3.3V** |
接线:`VCC→3.3V`,`GND→GND`,`SDA→GPIO22`,`SCL→GPIO27`。
## 功能
- 横屏网格布局:双圆弧仪表(LUX / 感知 LEVEL%)+ 底部左场景分级 / 右趋势图
- EMA 平滑、min/max、场景(DARK…DIRECT)、近似 EV、感知亮度条
- 圆弧与亮度条缓动动画;趋势折线 SHIFT 更新
- 短按切换背光(4 档);长按 ≥0.7s 重置 min/max
- 连续读失败容错;常亮运行
## 构建与烧录
依赖 [PlatformIO](https://platformio.org/)。
```bash
pio run -e cyd_28r -t upload
pio device monitor -b 115200
```
### 预编译固件
```powershell
cd firmware\cyd_28r
.\flash.ps1
```
源码更新后重新打包:`.\firmware\export_from_build.ps1`。
| 环境 | 适用 |
|------|------|
| `cyd_28r` | 标准 ILI9341 CYD(默认) |
| `cyd_28r_inv` | 颜色反相 / 发白 |
| `cyd_28_st7789` | USB-C 双口 / ST7789 变体 |
## 项目结构
```
platformio.ini # 板级与库依赖
include/lv_conf.h # LVGL 配置
src/main.cpp # 仪表盘主程序
scripts/exclude_lvgl_asm.py # 排除 ESP32 不兼容的 LVGL ASM
firmware/ # 预编译固件
README.md
```
## 变更记录
| 日期 | 说明 |
|------|------|
| 2026-10-20 | 初版:参考 temperature/sgp30test,GY30(BH1750) SDA=GPIO22 / SCL=GPIO27,LUX/LEVEL 双表盘、场景条、趋势图 |
| 2026-10-20 | 增加 `meta.json` 与 `media/preview.html`,供 cydweb 本地目录展示 |