We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cef7b0d + 1a1c2c9 commit 6f6442fCopy full SHA for 6f6442f
examples/UPS/UPS.ino
@@ -106,9 +106,9 @@ void loop() {
106
bool bDischarging = !bCharging; // TODO - replace with sensor
107
int iBattSoc = analogRead(BATTSOCPIN); // TODO - this is for debug only. Replace with charge estimation
108
109
- iRemaining = (byte)(round((float)100*iBattSoc/1024));
110
- iRunTimeToEmpty = (uint16_t)round((float)iAvgTimeToEmpty*iRemaining/100);
111
-
+ iRemaining = (byte)(round((float)iFullChargeCapacity*iBattSoc/1024));
+ iRunTimeToEmpty = (uint16_t)round((float)iAvgTimeToEmpty*iRemaining/iFullChargeCapacity);
+
112
// Charging
113
iPresentStatus.Charging = bCharging;
114
iPresentStatus.ACPresent = bACPresent;
0 commit comments