sensoresp/include/sensor_bmp280.h

38 lines
828 B
C
Raw Normal View History

2023-11-15 12:16:25 +00:00
#ifndef SENSOR_BMP280_H
#define SENSOR_BMP280_H
#include "sensordata.h"
#include <Homie.h>
#include <Adafruit_BMP280.h>
class Sensor_BMP280
{
private:
Adafruit_BMP280 *bmp280;
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_BMP280();
void loop_BMP280_temperature();
void loop_BMP280_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