sensoresp/include/sensor_ml8511.h

37 lines
648 B
C
Raw Normal View History

2021-11-04 17:47:43 +00:00
#ifndef SENSOR_ML8511_H
#define SENSOR_ML8511_H
#include "sensordata.h"
#include <Homie.h>
class Sensor_ML8511
{
private:
HomieNode *sensorNode; //reference to HomieNode
int ml8511pin;
struct sensordata data; //struct values are changed in setup()
bool init_ok;
float getUV_ML8511(int pin);
float mapfloat(float x, float in_min, float in_max, float out_min, float out_max);
public:
Sensor_ML8511(int pin);
void init();
void setSettings(float minchange, unsigned long senddelaymax, unsigned long readdelay);
void advertise(HomieNode& p_sensorNode);
void sensorloop();
};
#endif