From 81e4f9901c09ab68aaee30c3309f0e79098fcd50 Mon Sep 17 00:00:00 2001 From: Ollo Date: Sun, 12 Dec 2021 15:40:35 +0100 Subject: [PATCH] Always wait for I2C --- src/main.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c0bad67..4f6f93d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -467,12 +467,12 @@ void setup() if (mConfigured) { if (i2cEnable.get()) { - strip.fill(strip.Color(0,128,0)); + strip.fill(strip.Color(0,64,0)); strip.show(); -#ifdef BME680 - printf("Wait 1 second...\r\n"); - delay(1000); -#endif + printf("Wait 1 second...\r\n"); + delay(1000); + strip.fill(strip.Color(0,128,0)); + /* Extracted from library's example */ mFailedI2Cinitialization = !bmx.begin(); if (!mFailedI2Cinitialization) { @@ -558,8 +558,7 @@ void loop() mButtonPressed=0U; } - if (mButtonPressed > BUTTON_MAX_CYCLE) { - mButtonPressed = (BUTTON_MAX_CYCLE -1); + if (mButtonPressed > BUTTON_MAX_CYCLE) { if (SPIFFS.exists("/homie/config.json")) { strip.fill(strip.Color(0,128,0)); strip.show();