mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 18:52:30 +00:00
Use INA for device battery level (#2536)
* WIP * Continued wip * We got em * Voltage sensor base class * INA voltage * Log it * Stacie's mom has got it going on * Move declaration up * Last one * Sneaky little bugger * Macro guard to avoid calling methods
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include "VoltageSensor.h"
|
||||
#include <Adafruit_INA219.h>
|
||||
|
||||
class INA219Sensor : virtual public TelemetrySensor
|
||||
class INA219Sensor : virtual public TelemetrySensor, VoltageSensor
|
||||
{
|
||||
private:
|
||||
Adafruit_INA219 ina219;
|
||||
@@ -14,4 +15,5 @@ class INA219Sensor : virtual public TelemetrySensor
|
||||
INA219Sensor();
|
||||
virtual int32_t runOnce() override;
|
||||
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
||||
virtual uint16_t getBusVoltageMv() override;
|
||||
};
|
||||
Reference in New Issue
Block a user