WxBox/include/CCS811Sensor.h

24 lines
688 B
C
Raw Normal View History

2024-04-07 03:01:19 +03:00
// CCS811Sensor.h
#ifndef CCS811SENSOR_H
#define CCS811SENSOR_H
#define CCS811_WAK 23
2024-04-13 01:03:37 +03:00
#include <ccs811.h> // Include CCS811 library
2024-04-07 03:01:19 +03:00
class CCS811Sensor {
public:
CCS811Sensor(uint8_t wakePin = CCS811_WAK); // Constructor
void init(double* temperature, double* humidity); // temp and hum needed to correct env
void init(); // Initialize without temperature and humidity
void read_values(uint16_t* eco2, uint16_t* etvoc, uint16_t* errstat, uint16_t* raw);
private:
uint8_t _wakePin; // CCS811 wake pin
CCS811 ccs811; // CCS811 object
double* _temperaturePtr; // Pointer to temperature value
double* _humidityPtr; // Pointer to humidity value
};
#endif // CCS811SENSOR_H