From c7e79eba437b770a6e147aec77c4c09560fdb714 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Tue, 14 May 2024 02:01:24 -0400 Subject: [PATCH] bme680 fix for heltec v3 --- src/bme_utils.cpp | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/bme_utils.cpp b/src/bme_utils.cpp index 395f111..a28130b 100644 --- a/src/bme_utils.cpp +++ b/src/bme_utils.cpp @@ -16,10 +16,11 @@ float newHum, newTemp, newPress, newGas; Adafruit_BME280 bme280; -Adafruit_BME680 bme680; -#ifdef HELTEC_V3_GPS +#ifdef HELTEC_V3 Adafruit_BMP280 bmp280(&Wire1); +Adafruit_BME680 bme680(&Wire1); #else +Adafruit_BME680 bme680; Adafruit_BMP280 bmp280; #endif @@ -55,13 +56,6 @@ namespace BME_Utils { Serial.println("BME280 sensor found"); wxModuleType = 1; wxModuleFound = true; - } - if (!wxModuleFound) { - if (bme680.begin(wxModuleAddress, &Wire1)) { - Serial.println("BME680 sensor found"); - wxModuleType = 3; - wxModuleFound = true; - } } #else if (bme280.begin(wxModuleAddress)) { @@ -69,14 +63,14 @@ namespace BME_Utils { wxModuleType = 1; wxModuleFound = true; } - if (!wxModuleFound) { - if (bme680.begin(wxModuleAddress)) { - Serial.println("BME680 sensor found"); - wxModuleType = 3; - wxModuleFound = true; - } - } #endif + if (!wxModuleFound) { + if (bme680.begin(wxModuleAddress)) { + Serial.println("BME680 sensor found"); + wxModuleType = 3; + wxModuleFound = true; + } + } if (!wxModuleFound) { if (bmp280.begin(wxModuleAddress)) { Serial.println("BMP280 sensor found"); @@ -149,9 +143,9 @@ namespace BME_Utils { break; case 3: if ((int)bmeHum == 100) { - return "00"; + return "00"; } else { - return "-99"; + return "-99"; } break; default: