mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-29 22:20:37 +00: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
513 B
C++
19 lines
513 B
C++
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
|
#include "TelemetrySensor.h"
|
|
#include "VoltageSensor.h"
|
|
#include <Adafruit_INA260.h>
|
|
|
|
class INA260Sensor : virtual public TelemetrySensor, VoltageSensor
|
|
{
|
|
private:
|
|
Adafruit_INA260 ina260 = Adafruit_INA260();
|
|
|
|
protected:
|
|
virtual void setup() override;
|
|
|
|
public:
|
|
INA260Sensor();
|
|
virtual int32_t runOnce() override;
|
|
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
|
virtual uint16_t getBusVoltageMv() override;
|
|
}; |