From 4f66f97fe6f5e3e05fa12fc3df0f6411016aa4b8 Mon Sep 17 00:00:00 2001 From: pm73 Date: Wed, 8 Feb 2017 12:32:22 +0100 Subject: [PATCH] change loop to delay so ESP8266 can do Wi-Fi tasks delay(1) allows ESP8266 to do Wi-Fi tasks. It is recommended to not make any code that blocks this for more than 20/50 microseconds. --- Adafruit_BME280.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Adafruit_BME280.cpp b/Adafruit_BME280.cpp index 7b9c0ec..d36f0c2 100644 --- a/Adafruit_BME280.cpp +++ b/Adafruit_BME280.cpp @@ -303,7 +303,8 @@ void Adafruit_BME280::takeForcedMeasurement() write8(BME280_REGISTER_CONTROL, _measReg.get()); // wait until measurement has been completed, otherwise we would read // the values from the last measurement - while (read8(BME280_REGISTER_STATUS) & 0x08); + while (read8(BME280_REGISTER_STATUS) & 0x08) + delay(1); } }