Browse Source

Logic fixed for charging/charged pin

klaute 1 year ago
parent
commit
589be0474f
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      firmware/sensors.ino

+ 2
- 2
firmware/sensors.ino View File

@@ -63,10 +63,10 @@ float getBatteryVoltage() {
63 63
 }
64 64
 
65 65
 float isBatCharging() {
66
-  if (HIGH == digitalRead(BAT_CHARGED_PIN))
66
+  if (LOW == digitalRead(BAT_CHARGED_PIN))
67 67
   {
68 68
     return BAT_CHARGE_STATE_CHARGED;
69
-  } else if (HIGH == digitalRead(BAT_CHARGING_PIN))
69
+  } else if (LOW == digitalRead(BAT_CHARGING_PIN))
70 70
   {
71 71
     return BAT_CHARGE_STATE_CHARGING;
72 72
   }

Loading…
Cancel
Save