Skip to content

无人车电量检测与显示 - #3603

Closed
yuboyyy wants to merge 0 commit into
OpenHUTB:mainfrom
yuboyyy:main
Closed

yuboyyy wants to merge 0 commit into
OpenHUTB:mainfrom
yuboyyy:main

Conversation

@yuboyyy

@yuboyyy yuboyyy commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

修改概述:

优化电量百分比计算逻辑,将保留 1 位小数调整为保留 2 位小数,提升电量显示精度;

新增 GPIO 蜂鸣器告警功能,当电量低于 5% 时,触发 GPIO18 引脚输出高电平,驱动蜂鸣器发出告警声;
完善代码注释,补充硬件接入部分的示例代码说明,降低实际硬件适配门槛。

修改的详细描述

经过了什么样的测试?

  1. 操作系统
  2. Python版本等
操作系统:Ubuntu 22.04 LTS / Windows 10 / Raspberry Pi OS (bullseye)

Python 版本:Python 3.8.10 / Python 3.9.7 / Python 3.10.2
功能测试:
模拟电压输入 10.0~12.6V 区间值,验证电量百分比计算结果准确;
树莓派硬件测试,GPIO18 接蜂鸣器,电量低于 5% 时蜂鸣器正常告警;
长时间运行测试,循环读取 / 计算 / 显示逻辑无内存泄漏

运行效果

动图、视频、截图等

VID_20251218_132759.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant