|
|
@ -15,11 +15,15 @@ bool BME280::begin(void) { |
|
|
|
digitalWrite(23, HIGH); // enable bme280 CS
|
|
|
|
delay(50); |
|
|
|
bme = new Adafruit_BME280(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI
|
|
|
|
int retries = 0; |
|
|
|
while (!(status = bme->begin())) { |
|
|
|
if (retries > 5) break; |
|
|
|
retries++; |
|
|
|
Serial.println("Could not find a valid BME280 sensor, check wiring!"); |
|
|
|
// bme->reset();
|
|
|
|
delay(500); |
|
|
|
} |
|
|
|
if (!status) return false; |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|