Compare commits

...

3 Commits

Author SHA1 Message Date
cce4cba967 Update main.cpp 2024-07-07 15:10:37 -04:00
70ca4683be Update main.cpp 2024-07-07 15:04:21 -04:00
d4f5ff9c81 Update main.cpp 2024-07-07 14:59:58 -04:00

View File

@ -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
}