mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-28 03:56:33 +00:00

* DF Robot Lark weather station support * Missed it * I am a man of const char sorrow... * Strang * Use our fork * Add excludes
27 lines
665 B
C++
27 lines
665 B
C++
#include "configuration.h"
|
|
|
|
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
|
|
|
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
|
#include "TelemetrySensor.h"
|
|
#include <Adafruit_VEML7700.h>
|
|
|
|
class VEML7700Sensor : public TelemetrySensor
|
|
{
|
|
private:
|
|
const float MAX_RES = 0.0036;
|
|
const float GAIN_MAX = 2;
|
|
const float IT_MAX = 800;
|
|
Adafruit_VEML7700 veml7700;
|
|
float computeLux(uint16_t rawALS, bool corrected);
|
|
float getResolution(void);
|
|
|
|
protected:
|
|
virtual void setup() override;
|
|
|
|
public:
|
|
VEML7700Sensor();
|
|
virtual int32_t runOnce() override;
|
|
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
|
};
|
|
#endif |