#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd (0x27,16,2);
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.clear ();
lcd.backlight (),
dht.begin ();
Serial.begin (9600);
}
void loop() {
// put your main code here, to run repeatedly:
float humi = dht.readHumidity ();
float temp = dht.readTemperature ();
lcd.setCursor (0,0);
lcd.print ("Temp:");
lcd.setCursor (7,0);
lcd.print (temp);
lcd.setCursor (13,0);
lcd.print ((char)223);
lcd.setCursor (14,0);
lcd.print ("C");
lcd.setCursor(0,1);
lcd.print ("Humi :");
lcd.setCursor(7,1);
lcd.print (humi);
lcd.setCursor(12,1);
lcd.print ("%");
delay (1000);
}