2024-06-04 07:04:25 -05:00
|
|
|
#include "configuration.h"
|
|
|
|
|
|
|
|
|
|
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
|
|
|
|
|
2024-05-07 16:11:41 -04:00
|
|
|
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
|
|
|
|
#include "TelemetrySensor.h"
|
|
|
|
|
#include <Adafruit_VEML7700.h>
|
|
|
|
|
|
|
|
|
|
class VEML7700Sensor : public TelemetrySensor
|
|
|
|
|
{
|
|
|
|
|
private:
|
2024-05-14 16:42:23 -04:00
|
|
|
const float MAX_RES = 0.0036;
|
|
|
|
|
const float GAIN_MAX = 2;
|
|
|
|
|
const float IT_MAX = 800;
|
2024-05-07 16:11:41 -04:00
|
|
|
Adafruit_VEML7700 veml7700;
|
2024-05-14 16:42:23 -04:00
|
|
|
float computeLux(uint16_t rawALS, bool corrected);
|
|
|
|
|
float getResolution(void);
|
2024-05-07 16:11:41 -04:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void setup() override;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
VEML7700Sensor();
|
|
|
|
|
virtual int32_t runOnce() override;
|
|
|
|
|
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
2024-06-04 07:04:25 -05:00
|
|
|
};
|
|
|
|
|
#endif
|