changed isBatteryLow function to check voltage
instead of percent
This commit is contained in:
@@ -45,8 +45,8 @@ double Battery::getBatteryVoltage() {
|
||||
return (int)(res*100+0.5)/100.0;
|
||||
}
|
||||
|
||||
bool Battery::isBatteryLow(uint8_t percent) {
|
||||
if (this->getBatteryPercent() <= percent && this->batteryVoltage > this->absurdLowVoltage)
|
||||
bool Battery::isBatteryLow(double voltage) {
|
||||
if (this->getBatteryVoltage() <= voltage && this->batteryVoltage > this->absurdLowVoltage)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user