#include "DHT.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
#define DHTPIN 12
#define DHTTYPE DHT22
DHT dht(DHTPIN,DHTTYPE);
void setup() {
dht.begin();
lcd.init();
Serial.begin(9600);
}
void loop() {
delay(2000);
float h=dht.readHumidity();
float t=dht.readTemperature();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Humidade: ");
lcd.print(h);
lcd.print("% ");
lcd.setCursor(0,1);
lcd.print("Temperatura: ");
lcd.print(t);
lcd.print((char)223);
lcd.print("C ");
}