Skip to content

Commit 7590012

Browse files
ble-devble-dev
andauthored
BME sensor delay (#211)
Co-authored-by: ble-dev <a2zugmhz4@mozmail.com>
1 parent 479dc41 commit 7590012

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

platformio/include/config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
#define SENSOR_BME280
4848
// #define SENSOR_BME680
4949

50+
// If you enconter issues with the BME280 sensor showing no data, uncomment and
51+
// add a small delay before reading it's value. 300ms seems to work for most people
52+
// #define SENSOR_INIT_DELAY_MS 300
53+
5054
// 3 COLOR E-INK ACCENT COLOR
5155
// Defines the 3rd color to be used when a 3+ color display is selected.
5256
#if defined(DISP_3C_B) || defined(DISP_7C_F)

platformio/src/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ void setup()
292292
// GET INDOOR TEMPERATURE AND HUMIDITY, start BMEx80...
293293
pinMode(PIN_BME_PWR, OUTPUT);
294294
digitalWrite(PIN_BME_PWR, HIGH);
295+
#if defined(SENSOR_INIT_DELAY_MS) && SENSOR_INIT_DELAY_MS > 0
296+
delay(SENSOR_INIT_DELAY_MS);
297+
#endif
295298
TwoWire I2C_bme = TwoWire(0);
296299
I2C_bme.begin(PIN_BME_SDA, PIN_BME_SCL, 100000); // 100kHz
297300
float inTemp = NAN;

0 commit comments

Comments
 (0)