37 lines
654 B
C
37 lines
654 B
C
|
#ifndef SENSOR_VL53L1X_H
|
||
|
#define SENSOR_VL53L1X_H
|
||
|
|
||
|
#include "sensordata.h"
|
||
|
#include <Homie.h>
|
||
|
|
||
|
|
||
|
#include <Wire.h>
|
||
|
#include <VL53L1X.h>
|
||
|
|
||
|
class Sensor_VL53L1X
|
||
|
{
|
||
|
|
||
|
private:
|
||
|
VL53L1X *vl53l1x;
|
||
|
HomieNode *sensorNode; //reference to HomieNode
|
||
|
|
||
|
struct sensordata data; //struct values are changed in setup()
|
||
|
|
||
|
bool init_ok;
|
||
|
|
||
|
unsigned long lastread_vl53l1x=0;
|
||
|
VL53L1X::RangeStatus lastsentvalue_vl53l1x_status;
|
||
|
|
||
|
public:
|
||
|
Sensor_VL53L1X();
|
||
|
|
||
|
void init();
|
||
|
void setSettings(float minchange, unsigned long senddelaymax, unsigned long readdelay);
|
||
|
void advertise(HomieNode& p_sensorNode);
|
||
|
void sensorloop();
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif
|
||
|
|