Updates
This commit is contained in:
@@ -10,6 +10,7 @@ public:
|
||||
int percent() const { return _percent; }
|
||||
float voltage() const { return _voltage; }
|
||||
bool isLow() const { return _isLow; }
|
||||
bool isCharging() const { return _isCharging; }
|
||||
bool shouldBlink() const;
|
||||
|
||||
// For display
|
||||
@@ -18,6 +19,7 @@ public:
|
||||
private:
|
||||
static constexpr int PIN_BATTERY_ADC = 2; // Voltage divider input
|
||||
static constexpr int PIN_LBO = 5; // PowerBoost LBO pin
|
||||
static constexpr int PIN_CHG = 4; // PowerBoost CHG pin (LOW when charging)
|
||||
|
||||
static constexpr unsigned long CHECK_INTERVAL_MS = 2000;
|
||||
static constexpr int SAMPLES = 10; // Number of ADC samples to average
|
||||
@@ -33,6 +35,7 @@ private:
|
||||
int _percent = 100;
|
||||
float _voltage = 3.7;
|
||||
bool _isLow = false;
|
||||
bool _isCharging = false;
|
||||
unsigned long _lastCheckMs = 0;
|
||||
|
||||
float readBatteryVoltage();
|
||||
|
||||
Reference in New Issue
Block a user