#include <LiquidCrystal_I2C.h> 
#include <DHT11.h>
int pin=4;
DHT11 dht11(pin);
LiquidCrystal_I2C lcd(0x27,16,2);
void setup()
{
  lcd.begin();
  lcd.setCursor(0,0);lcd.print("H =    %RH");
  lcd.setCursor(0,1);lcd.print("T =    C");
}
void loop()
{
int err;
  float temp, humi;
  if((err=dht11.read(humi, temp))==0)
  {
    Serial.print("temperature:");
    Serial.print(temp);
    Serial.print(" humidity:");
    Serial.print(humi);
    Serial.println();
    
  }
  else
  {
    Serial.println();
    Serial.print("Error No :");
    Serial.print(err);
    Serial.println();    
  }
  lcd.setCursor(4,0);
  lcd.print(humi);
  lcd.setCursor(4,1);
  lcd.print(temp);
  delay(300);
}

