2025-01-18 14:10:13 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#ifndef _MT_DFROBOTGRAVITYSENSOR_H
|
|
|
|
|
#define _MT_DFROBOTGRAVITYSENSOR_H
|
|
|
|
|
#include "configuration.h"
|
|
|
|
|
|
2025-04-28 18:35:13 -05:00
|
|
|
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<DFRobot_RainfallSensor.h>)
|
2025-01-18 14:10:13 +01:00
|
|
|
|
|
|
|
|
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
|
|
|
|
#include "TelemetrySensor.h"
|
|
|
|
|
#include <DFRobot_RainfallSensor.h>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
class DFRobotGravitySensor : public TelemetrySensor
|
|
|
|
|
{
|
|
|
|
|
private:
|
2025-10-13 18:09:33 +02:00
|
|
|
DFRobot_RainfallSensor_I2C *gravity = nullptr;
|
2025-01-18 14:10:13 +01:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
DFRobotGravitySensor();
|
2025-10-13 18:09:33 +02:00
|
|
|
~DFRobotGravitySensor();
|
2025-01-18 14:10:13 +01:00
|
|
|
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
2025-10-13 18:09:33 +02:00
|
|
|
virtual bool initDevice(TwoWire *bus, ScanI2C::FoundDevice *dev) override;
|
2025-01-18 14:10:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|