#include <LiquidCrystal.h>
#include <DHT.h>
int rs=7;
int en=8;
int d4=9;
int d5=10;
int d6=11;
int d7=12;
int dt=500;
#define Type DHT22
int sensePin=2;
DHT HT(sensePin,Type);
float tempF;
float tempC;
int setTime=500;
LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
HT.begin();
delay(setTime);
lcd.begin(16,2);
}
void loop() {
// put your main code here, to run repeatedly:
lcd.setCursor(0,0);
lcd.print("TempC: ");
lcd.print(tempC);
lcd.print(" C");
lcd.setCursor(0,1);
lcd.print("TempF: ");
lcd.print(tempF);
lcd.print(" F");
delay(dt);
lcd.clear();
tempF=HT.readTemperature(true);
tempC=HT.readTemperature();
}