增加电量不足触发rgb红色闪烁

This commit is contained in:
myperworld committed 2025-11-30 19:47:22 +08:00
1 parent ada5b9aad9
commit eb9cf6622e
1 file changed
+5 -2
+5 -2
View File
@@ -1,4 +1,5 @@
#include "VoltageMonitor.h"
#include "RGBController.h"
// 初始化电压检测相关全局变量(与头文件声明对应)
uint16_t bat_check_num = 0;
@@ -36,10 +37,12 @@ void bat_check()
double battery = (voltage * 3.97) / 1000.0;
// 电量显示(LED_BAT引脚控制)
if (battery >= 7.8)
if (battery >= 7.8){
digitalWrite(LED_BAT, HIGH);
else
}else{
digitalWrite(LED_BAT, LOW);
startLEDBlink(CRGB::Red, 200, 5);
}
bat_check_num = 0;
}
else