From 3a5b0c82fb8e79ff84e3b063d6a6705311c98bb6 Mon Sep 17 00:00:00 2001 From: Alexandre B Date: Sun, 7 Jul 2024 14:06:54 -0400 Subject: [PATCH] Update main.cpp --- ESP32-BME280/src/main.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ESP32-BME280/src/main.cpp b/ESP32-BME280/src/main.cpp index cd283253d..5374886c4 100644 --- a/ESP32-BME280/src/main.cpp +++ b/ESP32-BME280/src/main.cpp @@ -4,10 +4,10 @@ #include #include -#define BMP280 +#define BME280 + + -Adafruit_BME280 bme; -Adafruit_BMP280 bmp; struct { float humidity = 0.0; @@ -25,8 +25,8 @@ void setup() { sensors_values.temperature = 0.0; #ifdef BME280 - // BME280 - unsigned status = bme.begin(BME280_ADDRESS_ALTERNATE);// 0x76); // I2C slave address 0x76 (SDO set to GND) + Adafruit_BME280 bme; + unsigned status = bme.begin(0x76); // I2C slave address 0x76 (SDO set to GND) if (!status) { Serial.println("Could not find a valid BME/BMP280 sensor, check wiring!"); Serial.print("SensorID was: 0x"); Serial.println(bme.sensorID(), 16); @@ -43,7 +43,8 @@ void setup() { } #endif #ifdef BMP280 - unsigned status = bmp.begin(BMP280_ADDRESS); + Adafruit_BMP280 bmp; + unsigned status = bmp.begin(); if (!status) { Serial.println("Could not find a valid BME/BMP280 sensor, check wiring!"); Serial.print("SensorID was: 0x"); Serial.println(bme.sensorID(), 16);