#include <dht.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define dataPin 8 // Defines pin number to which the sensor is connected
dht DHT; // Creats a DHT object
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
Serial.begin(9600);
lcd.init();
// Print a message to the LCD.
lcd.backlight();
}
void loop()
{
//Uncomment whatever type you're using!
int readData = DHT.read22(dataPin); // DHT22/AM2302
//int readData = DHT.read11(dataPin); // DHT11
float t = DHT.temperature; // Gets the values of the temperature
float h = DHT.humidity; // Gets the values of the humidity
// Printing the results on the serial monitor
lcd.setCursor(0,0);
lcd.print("Temperature = ");
lcd.setCursor(0,1);
lcd.print(t);
lcd.print(" *C");
delay(2000); // Delays 2 secods
}