BMP280 MS5611 added

This commit is contained in:
Myk
2024-04-13 01:03:37 +03:00
parent 54285dd721
commit 258fa0097d
9 changed files with 294 additions and 29 deletions

21
include/BMP280Sensor.h Normal file
View File

@@ -0,0 +1,21 @@
// BMP280Sensor.h
#ifndef BMP280SENSOR_H
#define BMP280SENSOR_H
#define BMP280_ADDR (0x76)
#define SEALEVELPRESSURE_HPA (1013.25)
#include <Adafruit_BME280.h>
class BMP280Sensor {
public:
BMP280Sensor(uint8_t address = BMP280_ADDR); // Constructor
void init();
void read_values(float* temperature, float* humidity, float* pressure, float* altitude);
private:
uint8_t _address; // BMP280 wake pin
Adafruit_BME280 bmp280; // BMP280 object
};
#endif // BMP280SENSOR_H

View File

@@ -4,7 +4,7 @@
#define CCS811SENSOR_H
#define CCS811_WAK 23
#include "ccs811.h" // Include CCS811 library
#include <ccs811.h> // Include CCS811 library
class CCS811Sensor {
public:

19
include/MS5611Sensor.h Normal file
View File

@@ -0,0 +1,19 @@
// MS5611Sensor.h
#ifndef MS5611SENSOR_H
#define MS5611SENSOR_H
#include <MS5611.h>
class MS5611Sensor {
public:
MS5611Sensor(); // Constructor
void init(); // Initialize without temperature and humidity
void read_values(double* temperature, double* preasure, double* altitude);
private:
uint8_t _address; // MS5611 I2C address
MS5611 ms5611; // MS5611 object
};
#endif // MS5611SENSOR_H