#include dht DHT; #define DHT11_PIN 5 void setup() { Serial.begin(115200); Serial.println("DHT TEST PROGRAM "); Serial.print("LIBRARY VERSION: "); Serial.println(DHT_LIB_VERSION); Serial.println(); Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)"); } void loop() { // Lectura de datos Serial.print("Sensor de Humedad Temperatura , \t"); int chk = DHT.read11(DHT11_PIN); switch (chk) { case DHTLIB_OK: Serial.print("Leyendo,\t"); break; case DHTLIB_ERROR_CHECKSUM: Serial.print("Checksum error,\t"); break; case DHTLIB_ERROR_TIMEOUT: Serial.print("Time out error,\t"); break; case DHTLIB_ERROR_CONNECT: Serial.print("Error de conexión,\t"); break; case DHTLIB_ERROR_ACK_L: Serial.print("Ack Low error,\t"); break; case DHTLIB_ERROR_ACK_H: Serial.print("Ack High error,\t"); break; default: Serial.print("Unknown error,\t"); break; } // Datos de salida Serial.print(DHT.humidity, 2); Serial.print(",\t"); Serial.println(DHT.temperature, 2); delay(200); } // //