mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2024-10-05 20:47:50 -04:00
Compare commits
3 Commits
6d13a0ff53
...
cce4cba967
Author | SHA1 | Date | |
---|---|---|---|
cce4cba967 | |||
70ca4683be | |||
d4f5ff9c81 |
@ -3,14 +3,16 @@
|
||||
|
||||
#include <WiFiClientSecure.h>
|
||||
|
||||
#define BMP280
|
||||
//#define BMP280
|
||||
#define BME280
|
||||
|
||||
#ifdef BME280
|
||||
#include <Adafruit_BME280.h>
|
||||
#endif
|
||||
|
||||
#ifdef BMP280
|
||||
#include <Adafruit_BMP280.h>
|
||||
//#include <Adafruit_BMP280.h>
|
||||
#include <Adafruit_BME280.h>
|
||||
#endif
|
||||
|
||||
struct {
|
||||
@ -24,6 +26,12 @@ void setup() {
|
||||
Serial.begin(115200);
|
||||
Serial.println();
|
||||
Serial.println("Running setup ...");
|
||||
#ifdef BME280
|
||||
Serial.println("BME280");
|
||||
#endif
|
||||
#ifdef BMP280
|
||||
Serial.println("BMP280");
|
||||
#endif
|
||||
sensors_values.humidity = 0.0;
|
||||
sensors_values.pressure = 0.0;
|
||||
sensors_values.temperature = 0.0;
|
||||
@ -47,7 +55,8 @@ void setup() {
|
||||
}
|
||||
#endif
|
||||
#ifdef BMP280
|
||||
Adafruit_BMP280 bmp;
|
||||
//Adafruit_BMP280 bmp;
|
||||
Adafruit_BME280 bmp;
|
||||
unsigned status = bmp.begin(0x58);
|
||||
if (!status) {
|
||||
Serial.println("Could not find a valid BME/BMP280 sensor, check wiring!");
|
||||
@ -58,7 +67,10 @@ void setup() {
|
||||
Serial.print(" ID of 0x61 represents a BME 680.\n");
|
||||
while (1) delay(10);
|
||||
}
|
||||
else {}
|
||||
else {
|
||||
sensors_values.pressure = bmp.readPressure() / 100.0F;
|
||||
sensors_values.temperature = bmp.readTemperature();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user