mirror of
https://github.com/meshtastic/firmware.git
synced 2026-02-02 11:41:13 -05:00
* 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
19 lines
493 B
C++
19 lines
493 B
C++
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
|
#include "TelemetrySensor.h"
|
|
#include "VoltageSensor.h"
|
|
#include <Adafruit_INA219.h>
|
|
|
|
class INA219Sensor : virtual public TelemetrySensor, VoltageSensor
|
|
{
|
|
private:
|
|
Adafruit_INA219 ina219;
|
|
|
|
protected:
|
|
virtual void setup() override;
|
|
|
|
public:
|
|
INA219Sensor();
|
|
virtual int32_t runOnce() override;
|
|
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
|
virtual uint16_t getBusVoltageMv() override;
|
|
}; |