voidloop(){ delay(1000); // Humidity is measured float humidity = dht.readHumidity(); // Temperature is measured float temperature = dht.readTemperature(); // Checks whether the measurements have run through without errors // If an error is detected, an error message is output here if (isnan(humidity) || isnan(temperature)) { Serial.println("Error when reading out the sensor"); return; } // Output to the serial console Serial.println("-----------------------------------------------------------"); Serial.print(" Humidity: "); Serial.print(humidity); Serial.print(" %\t"); Serial.print(" Temperature: "); Serial.print(temperature); Serial.println(" °C "); Serial.println("-----------------------------------------------------------"); Serial.println(" "); }