#include <DHT.h>
#define Type DHT22
#include <LiquidCrystal.h>
int rs = 7;
int en = 8;
int d4 = 9;
int d5 = 10;
int d6 = 11;
int d7 = 12;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int sensePin = 2;
DHT HT(sensePin, Type);
float humidity;
float tempC;
float tempF;
int setTime = 500;
int dur = 1000;
String one = "Temp F: ";
String two = "Humidity: ";
String three = "%";
String four = "% Temp: ";
String five = "C, ";
String six = "F";
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:
humidity = HT.readHumidity();
tempC = HT.readTemperature();
tempF = HT.readTemperature(true);
lcd.setCursor(0, 0);
lcd.print(one + tempF);
lcd.setCursor(0, 1);
lcd.print(two + humidity + three);
delay(dur);
lcd.clear();
Serial.println(two + humidity + four + tempC + five + tempF + six);
}