File tree 1 file changed +7
-6
lines changed
examples/temperaturesensor/AHT10
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -96,15 +96,16 @@ void handleTemperaturesensor() {
96
96
Serial.printf (" Sensor not initialized\r\n " );
97
97
return ;
98
98
}
99
- sensors_event_t hum, temp;
100
- aht.getEvent (&hum, &temp);
101
- float humidity = hum.relative_humidity ;
102
- float temperature = temp.temperature ;
103
-
99
+
100
+ sensors_event_t hum, temp;
101
+ aht.getEvent (&hum, &temp);
102
+ float humidity = hum.relative_humidity ;
103
+ float temperature = temp.temperature ;
104
+
104
105
if (isnan (temperature) || isnan (humidity)) { // reading failed...
105
106
Serial.printf (" AHT reading failed!\r\n " ); // print error message
106
107
return ; // try again next time
107
- }
108
+ }
108
109
109
110
if (temperature == lastTemperature || humidity == lastHumidity) return ; // if no values changed do nothing...
110
111
You can’t perform that action at this time.
0 commit comments