-
Notifications
You must be signed in to change notification settings - Fork 0
/
rz_bme680.h
70 lines (56 loc) · 1.61 KB
/
rz_bme680.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
TITLE:
rz_bme680.h
BRIEF:
Arduino lib for ESP32 BME680 sensor
DESC:
Arduino ESP32 library for BME680 sensor (temperature, humidity, pressure, gas)
SOURCE:
https://github.com/Zheng-Bote/ESP32_libs
SYNTAX:
#include "rz_bme680.h" | #include "ESP32/rz_bme680.h"
RZ_BME680 *bme680sensor = new RZ_BME680();
bme680sensor->readData();
if(bme680sensor->getSensorStatus()) {
Serial.println("\n-- BME680 sensor failed.\n");
}
else {
Serial.print("-- Temperature: "); Serial.println(bme680sensor->getTemperature());
Serial.print("-- Humidity: "); Serial.println(bme680sensor->getHumidity());
Serial.print("-- Pressure: "); Serial.println(bme680sensor->getPressure());
Serial.print("-- Gas: "); Serial.println(bme680sensor->getGas());
}
RETURN:
void readData();
String getTemperature();
String getHumidity();
String getPressure();
String getGas();
bool getSensorStatus();
HISTORY:
Version | Date | Developer | Comments
------- | ---------- | ---------- | ---------------------------------------------------------------
1.0.0 | 2022-02-27 | RZheng | created
*/
#ifndef rz_bme680_h
#define rz_bme680_h
#include "Arduino.h"
class RZ_BME680 {
public:
RZ_BME680();
void readData();
String getTemperature();
String getHumidity();
String getPressure();
String getGas();
bool getSensorStatus();
private:
String _bme680_temperature;
String _bme680_humidity;
String _bme680_pressure;
String _bme680_gasResistance;
bool _sensorError;
~RZ_BME680() {
}
};
#endif