We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d017096 commit 6db1379Copy full SHA for 6db1379
lib/Battery/battery.cpp
@@ -38,7 +38,7 @@ bool EPS::readVoltate()
38
39
samples = analogRead(PIN_BATT_VOLTAGE);
40
// Determine Battery Voltage
41
- data.batteryVoltage = ((samples * Vref) / ADC_resolution) * (R2 / (R1 + R2));
+ data.batteryVoltage = ((samples * Vref) / ADC_resolution) * ((R1 + R2) /R2 );
42
batteryVoltageTimer.restart();
43
44
if (data.batteryVoltage < MIN_BATTERY_VOLTAGE)
0 commit comments