mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 09:43:03 +00:00
TI OPT3001 light sensor support (#4015)
* TI OPT3001 light sensor support * Added register interrogation to deconflict with SHT sensors on same address
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "Sensor/BMP280Sensor.h"
|
||||
#include "Sensor/LPS22HBSensor.h"
|
||||
#include "Sensor/MCP9808Sensor.h"
|
||||
#include "Sensor/OPT3001Sensor.h"
|
||||
#include "Sensor/RCWL9620Sensor.h"
|
||||
#include "Sensor/SHT31Sensor.h"
|
||||
#include "Sensor/SHT4XSensor.h"
|
||||
@@ -42,6 +43,7 @@ LPS22HBSensor lps22hbSensor;
|
||||
SHT31Sensor sht31Sensor;
|
||||
VEML7700Sensor veml7700Sensor;
|
||||
TSL2591Sensor tsl2591Sensor;
|
||||
OPT3001Sensor opt3001Sensor;
|
||||
SHT4XSensor sht4xSensor;
|
||||
RCWL9620Sensor rcwl9620Sensor;
|
||||
AHT10Sensor aht10Sensor;
|
||||
@@ -109,6 +111,8 @@ int32_t EnvironmentTelemetryModule::runOnce()
|
||||
result = veml7700Sensor.runOnce();
|
||||
if (tsl2591Sensor.hasSensor())
|
||||
result = tsl2591Sensor.runOnce();
|
||||
if (opt3001Sensor.hasSensor())
|
||||
result = opt3001Sensor.runOnce();
|
||||
if (rcwl9620Sensor.hasSensor())
|
||||
result = rcwl9620Sensor.runOnce();
|
||||
if (aht10Sensor.hasSensor())
|
||||
@@ -299,6 +303,10 @@ bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
||||
valid = valid && tsl2591Sensor.getMetrics(&m);
|
||||
hasSensor = true;
|
||||
}
|
||||
if (opt3001Sensor.hasSensor()) {
|
||||
valid = valid && opt3001Sensor.getMetrics(&m);
|
||||
hasSensor = true;
|
||||
}
|
||||
if (rcwl9620Sensor.hasSensor()) {
|
||||
valid = valid && rcwl9620Sensor.getMetrics(&m);
|
||||
hasSensor = true;
|
||||
|
||||
Reference in New Issue
Block a user