#include #define DHTPIN 2 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(9600); dht.begin(); } void loop() { float humidity = dht.readHumidity(); float temperature = dht.readTemperature(); if (isnan(humidity) || isnan(temperature)) { Serial.println(F("Echec de la lecture du capteur DHT !")); return; } Serial.print(F("Humidity : ")); Serial.print(humidity); Serial.print(F("%\t")); Serial.print(F("Temperature : ")); Serial.print(temperature); Serial.println(F("C")); delay(2000); }