split project a bit

This commit is contained in:
Myk
2024-04-07 03:01:19 +03:00
parent 590d4958c2
commit 54285dd721
5 changed files with 129 additions and 76 deletions

23
include/CCS811Sensor.h Normal file
View File

@@ -0,0 +1,23 @@
// CCS811Sensor.h
#ifndef CCS811SENSOR_H
#define CCS811SENSOR_H
#define CCS811_WAK 23
#include "ccs811.h" // Include CCS811 library
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

20
include/HDC1080Sensor.h Normal file
View File

@@ -0,0 +1,20 @@
// HDC1080Sensor.h
#ifndef HDC1080SENSOR_H
#define HDC1080SENSOR_H
#define HDC1080_ADDR 0x40
#include "ClosedCube_HDC1080.h"
class HDC1080Sensor {
public:
HDC1080Sensor(uint8_t address = HDC1080_ADDR); // Constructor
void init(); // Initialize HDC1080 sensor
void read_values(double* temperature, double* humidity, bool* success); // Read temperature and humidity values
private:
uint8_t _address; // HDC1080 I2C address
ClosedCube_HDC1080 hdc1080; // HDC1080 object
};
#endif // HDC1080SENSOR_H