38 lines
828 B
C++
38 lines
828 B
C++
#ifndef SENSOR_BMP180_H
|
|
#define SENSOR_BMP180_H
|
|
|
|
#include "sensordata.h"
|
|
#include <Homie.h>
|
|
|
|
#include <Adafruit_BMP085.h>
|
|
|
|
|
|
class Sensor_BMP180
|
|
{
|
|
|
|
private:
|
|
Adafruit_BMP085 *bmp180;
|
|
HomieNode *sensorNode; //reference to HomieNode
|
|
|
|
struct sensordata data_temperature; //struct values are changed in setup()
|
|
struct sensordata data_pressure; //struct values are changed in setup()
|
|
|
|
bool init_ok;
|
|
|
|
public:
|
|
Sensor_BMP180();
|
|
|
|
void loop_BMP180_temperature();
|
|
void loop_BMP180_pressure();
|
|
|
|
void init();
|
|
void setSettings_Temperature(float minchange, unsigned long senddelaymax, unsigned long readdelay);
|
|
void setSettings_Pressure(float minchange, unsigned long senddelaymax, unsigned long readdelay);
|
|
void advertise(HomieNode& p_sensorNode);
|
|
void sensorloop();
|
|
|
|
};
|
|
|
|
#endif
|
|
|