44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
#ifndef SENSOR_MULTICHANNELGASGMXXX_H
|
|
#define SENSOR_MULTICHANNELGASGMXXX_H
|
|
|
|
#include "sensordata.h"
|
|
#include <Homie.h>
|
|
|
|
#include <Multichannel_Gas_GMXXX.h>
|
|
#include <Wire.h>
|
|
|
|
|
|
class Sensor_MULTICHANNELGASGMXXX
|
|
{
|
|
|
|
private:
|
|
GAS_GMXXX<TwoWire> *gas;
|
|
HomieNode *sensorNode; //reference to HomieNode
|
|
|
|
struct sensordata data_no2; //struct values are changed in setup()
|
|
struct sensordata data_c2h5oh;
|
|
struct sensordata data_voc;
|
|
struct sensordata data_co;
|
|
|
|
|
|
bool init_ok;
|
|
|
|
public:
|
|
Sensor_MULTICHANNELGASGMXXX();
|
|
|
|
void init();
|
|
void setSettings_no2(float minchange, unsigned long senddelaymax, unsigned long readdelay);
|
|
void setSettings_c2h5oh(float minchange, unsigned long senddelaymax, unsigned long readdelay);
|
|
void setSettings_voc(float minchange, unsigned long senddelaymax, unsigned long readdelay);
|
|
void setSettings_co(float minchange, unsigned long senddelaymax, unsigned long readdelay);
|
|
void advertise(HomieNode& p_sensorNode);
|
|
void sensorloop_no2(); // GM-102B Nitrogen Dioxide
|
|
void sensorloop_c2h5oh(); //GM-302B Ethyl Alcohol
|
|
void sensorloop_voc(); // GM-502B Volatile Organic Compounds
|
|
void sensorloop_co(); // GM-702B Carbon Monoxide
|
|
|
|
};
|
|
|
|
#endif
|
|
|