35 lines
554 B
C
35 lines
554 B
C
|
#ifndef SENSOR_BH1750_H
|
||
|
#define SENSOR_BH1750_H
|
||
|
|
||
|
#include "sensordata.h"
|
||
|
#include <Homie.h>
|
||
|
|
||
|
|
||
|
#include <BH1750.h>
|
||
|
#include <Wire.h>
|
||
|
|
||
|
|
||
|
class Sensor_BH1750
|
||
|
{
|
||
|
|
||
|
private:
|
||
|
BH1750 *bh1750;
|
||
|
HomieNode *sensorNode; //reference to HomieNode
|
||
|
|
||
|
struct sensordata data; //struct values are changed in setup()
|
||
|
|
||
|
bool init_ok;
|
||
|
|
||
|
public:
|
||
|
Sensor_BH1750();
|
||
|
|
||
|
void init();
|
||
|
void setSettings(float minchange, unsigned long senddelaymax, unsigned long readdelay);
|
||
|
void advertise(HomieNode& p_sensorNode);
|
||
|
void sensorloop();
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif
|
||
|
|