2025-10-31 23:40:36 +01:00
|
|
|
#pragma once
|
|
|
|
|
#include "configuration.h"
|
|
|
|
|
|
|
|
|
|
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<BH1750_WE.h>)
|
|
|
|
|
|
|
|
|
|
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
|
|
|
|
#include "TelemetrySensor.h"
|
|
|
|
|
#include <BH1750_WE.h>
|
|
|
|
|
|
2026-01-03 21:19:24 +01:00
|
|
|
class BH1750Sensor : public TelemetrySensor {
|
|
|
|
|
private:
|
|
|
|
|
BH1750_WE bh1750;
|
2025-10-31 23:40:36 +01:00
|
|
|
|
2026-01-03 21:19:24 +01:00
|
|
|
public:
|
|
|
|
|
BH1750Sensor();
|
|
|
|
|
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
|
|
|
|
virtual bool initDevice(TwoWire *bus, ScanI2C::FoundDevice *dev) override;
|
2025-10-31 23:40:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|