/*
keyestudio Easy plug super kit 
Project 20
temperature and humidity sensor
http://www.keyestudio.com
*/
 #include <dht11.h>
 dht11 DHT;
 #define DHT11_PIN A0

void setup()
  {
  Serial.begin(9600);
  Serial.println();
  Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
  }

void loop()
  {
int chk;
Serial.print("DHT11, \t");
chk = DHT.read(DHT11_PIN);// READ DATA
switch (chk)
  {
  case DHTLIB_OK:
      Serial.print("OK,\t");
      break;
  case DHTLIB_ERROR_CHECKSUM: 
      Serial.print("Checksum error,\t"); 
      break;
  case DHTLIB_ERROR_TIMEOUT: 
      Serial.print("Time out error,\t"); 
      break;
  default: 
     Serial.print("Unknown error,\t"); 
     break;
    }// DISPLAT DATA
     Serial.print(DHT.humidity,1);
     Serial.print(",\t");
     Serial.println(DHT.temperature,1);
     delay(1000);
     }
//***********************************************************
