mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 18:52:30 +00:00
* Added full support for LTR390UV readings of UV and Lux * Trunk formatting * Added full support for LTR390UV readings of UV and Lux * Trunk formatting * fix library check and unnecessary bit resolution change * fixed log info messages and removed unused dependency * Hopefully fixes git mess * fix variable scope and getMetrics returns * set metrics flags bavk to false in case something wrong happens while reading LTR390UV mode --------- Co-authored-by: Domingo <domingo@waxman.local> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
25 lines
599 B
C++
25 lines
599 B
C++
#include "configuration.h"
|
|
|
|
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<Adafruit_LTR390.h>)
|
|
|
|
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
|
#include "TelemetrySensor.h"
|
|
#include <Adafruit_LTR390.h>
|
|
|
|
class LTR390UVSensor : public TelemetrySensor
|
|
{
|
|
private:
|
|
Adafruit_LTR390 ltr390uv = Adafruit_LTR390();
|
|
float lastLuxReading = 0;
|
|
float lastUVReading = 0;
|
|
|
|
protected:
|
|
virtual void setup() override;
|
|
|
|
public:
|
|
LTR390UVSensor();
|
|
virtual int32_t runOnce() override;
|
|
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
|
};
|
|
|
|
#endif |