Always wait for I2C

This commit is contained in:
Ollo 2021-12-12 15:40:35 +01:00
parent 5e27d3ebf4
commit 81e4f9901c

View File

@ -467,12 +467,12 @@ void setup()
if (mConfigured) if (mConfigured)
{ {
if (i2cEnable.get()) { if (i2cEnable.get()) {
strip.fill(strip.Color(0,128,0)); strip.fill(strip.Color(0,64,0));
strip.show(); strip.show();
#ifdef BME680
printf("Wait 1 second...\r\n"); printf("Wait 1 second...\r\n");
delay(1000); delay(1000);
#endif strip.fill(strip.Color(0,128,0));
/* Extracted from library's example */ /* Extracted from library's example */
mFailedI2Cinitialization = !bmx.begin(); mFailedI2Cinitialization = !bmx.begin();
if (!mFailedI2Cinitialization) { if (!mFailedI2Cinitialization) {
@ -559,7 +559,6 @@ void loop()
} }
if (mButtonPressed > BUTTON_MAX_CYCLE) { if (mButtonPressed > BUTTON_MAX_CYCLE) {
mButtonPressed = (BUTTON_MAX_CYCLE -1);
if (SPIFFS.exists("/homie/config.json")) { if (SPIFFS.exists("/homie/config.json")) {
strip.fill(strip.Color(0,128,0)); strip.fill(strip.Color(0,128,0));
strip.show(); strip.show();