#include <LiquidCrystal_I2C.h>
#include "DHT.h"
LiquidCrystal_I2C lcd(0x27, 16, 2);
DHT dht(2, DHT22);
void setup() {
lcd.init();
lcd.backlight();
dht.begin();
}
int t = 0;
int h = 0;
void temphum(){
h = dht.readHumidity();
t = dht.readTemperature();
lcd.setCursor(0, 0);
lcd.print("Temp : ");
lcd.print(t);
lcd.setCursor(0, 1);
lcd.print("Hum : ");
lcd.print(h);
delay(1000);
if (h >= 100 || h >= 10) {
lcd.setCursor(6, 1);
lcd.print(" ");
}
}
void loop() {
temphum();
/*h = dht.readHumidity();
t = dht.readTemperature();
lcd.setCursor(0, 0);
lcd.print("Temp : ");
lcd.print(t);
delay(300);
lcd.setCursor(0, 1);
lcd.print("Hum : ");
lcd.print(h);
delay(300);
if (h >= 100 || h <= 10) {
lcd.setCursor(7, 1);
lcd.print(" ");*/
}
/*
for(int col=16;col>=0;col--){
lcd.setCursor(col, 0);
lcd.print("Hello");
delay(300);
lcd.clear();
}
/*lcd.setCursor(col, 0);
lcd.print("Hello");
lcd.shift();
/*lcd.print(x);
x=x+1;
delay(20);
if(x>=100){
x=0;
lcd.clear();
}*/