mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-23 19:20:41 +00:00
Added full support for LTR390UV readings of UV and Lux (#6872)
* 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>
This commit is contained in:
25
src/modules/Telemetry/Sensor/LTR390UVSensor.h
Normal file
25
src/modules/Telemetry/Sensor/LTR390UVSensor.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user