#include <dht.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define dataPin 2
dht DHT;
LiquidCrystal_I2C lcd(0x27,16,2);
String line2="Gustavo Santos Pereira";
int stst;
int sted;
int stsc=16;
void setup(){
Serial.begin(9600);
lcd.init();
}
void loop(){
lcd.setBacklight(HIGH);
lcd.setCursor(0,0);
lcd.print("ETECAF");
lcd.setCursor(12,0);
lcd.print("SEM2");
lcd.setCursor(stsc, 1);
lcd.print(line2.substring(stst,sted));
delay(200);
lcd.clear();
if(stst==0 && stsc>0){
stsc--;
sted++;
}
else if(stst==sted){
stst=sted=0;
stsc=16;
}
else if(sted==line2.length() && stsc==0){
stst++;
}
else{
stst++;
sted++;
}
if (stst==22 && sted==22){
lcd.clear();
}
while(stst==22 && sted==22){
int readData=DHT.read22(dataPin);
float t=DHT.temperature;
float h=DHT.humidity;
lcd.setCursor(0,0);
lcd.print("Temp=");
lcd.print(t);
lcd.print("C");
lcd.setCursor(0,1);
lcd.print("Umi=");
lcd.print(h);
lcd.print("%");
}
}