Skip to content

Commit

Permalink
fixed issue with bme280 sensor detection
Browse files Browse the repository at this point in the history
  • Loading branch information
hpsaturn committed Nov 27, 2021
1 parent 2817cc1 commit cb5cb49
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Sensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,13 @@ void Sensors::am2320Read() {
void Sensors::bme280Read() {
float humi1 = bme280.readHumidity();
float temp1 = bme280.readTemperature();
if (humi1 != NAN) humi = humi1;
if (temp1 != NAN) {
temp = temp1-toffset;
dataReady = true;
DEBUG("-->[SLIB] BME280 read > done!");
}
if (isnan(humi1) || humi1 == 0) return;
humi = humi1;
temp = temp1-toffset;
pres = bme280.readPressure();
alt = bme280.readAltitude(SEALEVELPRESSURE_HPA);
dataReady = true;
DEBUG("-->[SLIB] BME280 read > done!");
}

void Sensors::bme680Read() {
Expand Down

0 comments on commit cb5cb49

Please sign in to comment.