int tempo = 1000;
#define dataPin 2
#include <Wire.h>
#include <dht.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
LiquidCrystal_I2C lcd2 (0x26,16,2);
dht DHT;
void setup() {
lcd.init();
lcd.backlight();
lcd2.init();
lcd2.backlight();
Serial.begin (9600);
Serial.println(" DHT22 ");
// put your setup code here, to run once:
}
void loop() {
lcd.clear();
lcd2.clear();
// put your main code here, to run repeatedly:
int readData = DHT.read22(dataPin);
float t = DHT.temperature;
float h = DHT.humidity;
Serial.print("Umidade :");
Serial.print(h);
Serial.println(" *humidade ");
Serial.print("Temperatura :");
Serial.print(t);
Serial.println(" *temp");
delay(tempo);
lcd2.setCursor(3,0);
lcd2.print("Humidade:");
lcd2.setCursor(4,1);
lcd2.print(h);
delay(1000);
lcd.setCursor(3,0);
lcd.print("Temperatura :");
lcd.setCursor(6,1);
lcd.print (t);
delay(1000);
lcd.clear();
}