You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-utilizing the on-board MAX17048 Fuel Guage IC on the ESP32 Thing Plus C.
-Printing battery state of charge (SOC) to terminal
-drawing a battery level indicator on the bottom right of the OLED - with 3 blocks to show 33/66/100 % batt levels.
Copy file name to clipboardExpand all lines: examples/Example_08_Demo_Oled/Example_08_Demo_Oled.ino
+110Lines changed: 110 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,12 @@ int height;
84
84
// writeStaticDisplayItems() function
85
85
int xPosPM25;
86
86
87
+
// Fuel Guage Specifics
88
+
#include<SparkFun_MAX1704x_Fuel_Gauge_Arduino_Library.h>// Click here to get the library: http://librarymanager/All#SparkFun_MAX1704x_Fuel_Gauge_Arduino_Library
89
+
SFE_MAX1704X lipo(MAX1704X_MAX17048); // Create a MAX17048
90
+
double soc = 0; // Variable to keep track of LiPo state-of-charge (SOC)
91
+
92
+
87
93
// Some Dev boards have their QWIIC connector on Wire or Wire1
88
94
// This #ifdef will help this sketch work across more products
89
95
@@ -98,6 +104,8 @@ void setup()
98
104
pinMode(StatLedPin, OUTPUT);
99
105
digitalWrite(StatLedPin, LOW);
100
106
107
+
lipo.disableDebugging(); // disable debugging for the MAX1704X fuel gauge
0 commit comments