//ETECAF
//SISTEMAS EMBARCADOS 3
//SEM3 – 2022
//Raul Santos da Silva
//RM: 35225
#include <dht.h>
#define dataPin 2
dht DHT;
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
lcd.begin(16,2);
lcd.setCursor(2, 0);
lcd.print("ETEC-AF SEM3");
lcd.setCursor(0,1);
lcd.print("Raul Santos da Silva");
delay(500);
for(int St1 = 0; St1 < 20; St1++){
lcd.scrollDisplayLeft();
delay(50);
}
delay(300);
lcd.clear();
}
void loop() {
int ler22 = DHT.read22(dataPin);
float t = DHT.temperature;
float h = DHT.humidity;
lcd.setCursor(2,0);
lcd.print("Temp. = ");
lcd.print(t);
lcd.print(" ");
lcd.setCursor(15,0);
lcd.print("C");
lcd.setCursor(0,1);
lcd.print("Humid. = ");
lcd.print(h);
lcd.print(" ");
lcd.setCursor(15,1);
lcd.print("%");
}