Skip to content

Commit

Permalink
Fixed float dht temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
gemi254 committed Apr 4, 2024
1 parent 6bc0040 commit 0d90091
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ bool initDHTsensor(){
int i = 5;
while (i--) {
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
//float t = pDht->readTemperature(false);
float h = pDht->readHumidity();
//float t = pDht->readTemperature(false,true);
if (isnan(h)) {
LOG_E("Failed to read from DHT sensor!\n");
// Wait a few seconds between measurements.
delay(500);
}else{
LOG_E("Probe DHT sensor h: %3.1f\n", h);
LOG_E("Probe DHT sensor h: %3.1f",h);
//LOG_E("Probe DHT sensor t: %3.1f, h: %3.1f\n",t, h);
return true;
}
}
Expand Down

0 comments on commit 0d90091

Please sign in to comment.