diff --git a/examples/advanced_multivariable/src/main.cpp b/examples/advanced_multivariable/src/main.cpp index 27ad8bd8..d3b37046 100644 --- a/examples/advanced_multivariable/src/main.cpp +++ b/examples/advanced_multivariable/src/main.cpp @@ -18,6 +18,8 @@ #include #include +#define MAIN_HW_EN_PIN 27 // Only for setup with booster board with enable pin + void printSensorsDetected() { uint16_t sensors_count = sensors.getSensorsRegisteredCount(); uint16_t units_count = sensors.getUnitsRegisteredCount(); @@ -56,9 +58,18 @@ void onSensorDataError(const char * msg){ * M A I N ******************************************************************************/ +void powerEnableSensors() { + // init all sensors (step-up to 5V with enable pin) + Serial.println("-->[POWR] == enable sensors =="); + pinMode(MAIN_HW_EN_PIN, OUTPUT); + digitalWrite(MAIN_HW_EN_PIN, HIGH); // step-up on +} + void setup() { Serial.begin(115200); delay(200); + // powerEnableSensors(); // Only for special setup hardware with enable + delay(100); Serial.println("\n== Sensor test setup ==\n"); Serial.println("-->[SETUP] Detecting sensors.."); @@ -73,4 +84,4 @@ void setup() { void loop() { sensors.loop(); // read sensor data and showed it -} \ No newline at end of file +} diff --git a/src/Sensors.cpp b/src/Sensors.cpp index 8a8a5b26..d1e4293b 100644 --- a/src/Sensors.cpp +++ b/src/Sensors.cpp @@ -1561,13 +1561,16 @@ void Sensors::sht31Init() { } void Sensors::bme280Init() { - sensorAnnounce(SENSORS::SBME280); - #ifndef Wire1 - if (!bme280.begin()) return; - #else - if (!bme280.begin() && !bme280.begin(BME280_ADDRESS,&Wire1)) return; - #endif - sensorRegister(SENSORS::SBME280); + sensorAnnounce(SENSORS::SBME280); + #ifndef Wire1 + if (!bme280.begin() && !bme280.begin(BME280_ADDRESS_ALTERNATE)) return; + #else + if (!bme280.begin() && + !bme280.begin(BME280_ADDRESS_ALTERNATE) && + !bme280.begin(BME280_ADDRESS, &Wire1) && + !bme280.begin(BME280_ADDRESS_ALTERNATE, &Wire1)) return; + #endif + sensorRegister(SENSORS::SBME280); } /// Environment BMP280 sensor init diff --git a/unified-lib-deps.ini b/unified-lib-deps.ini index 6fd4d49a..c649e8ae 100644 --- a/unified-lib-deps.ini +++ b/unified-lib-deps.ini @@ -1,11 +1,11 @@ [commonlibs] lib_deps = - adafruit/Adafruit Unified Sensor@1.1.13 - adafruit/Adafruit BME280 Library@2.2.2 + adafruit/Adafruit Unified Sensor@1.1.14 + adafruit/Adafruit BME280 Library@2.2.4 adafruit/Adafruit BMP280 Library@2.6.8 - adafruit/Adafruit BME680 Library@2.0.2 + adafruit/Adafruit BME680 Library@2.0.4 adafruit/Adafruit SHT31 Library@2.2.2 - adafruit/Adafruit SCD30@1.0.9 + adafruit/Adafruit SCD30@1.0.11 adafruit/Adafruit BusIO@1.14.5 robtillaart/AM232X@0.5.0 paulvha/sps30@1.4.17