Repository navigation
无人车电量检测与显示 - #3603
Closed
yuboyyy wants to merge 0 commit into
Closed
无人车电量检测与显示#3603yuboyyy wants to merge 0 commit into
yuboyyy wants to merge 0 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修改概述:
优化电量百分比计算逻辑,将保留 1 位小数调整为保留 2 位小数,提升电量显示精度;新增 GPIO 蜂鸣器告警功能,当电量低于 5% 时,触发 GPIO18 引脚输出高电平,驱动蜂鸣器发出告警声;
完善代码注释,补充硬件接入部分的示例代码说明,降低实际硬件适配门槛。
修改的详细描述
经过了什么样的测试?
- 操作系统
- 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