#include <LiquidCrystal.h>
#include <DHT.h>
LiquidCrystal lcd(12, 11, 9, 8, 7,6,5,4,3,2);
#define DHTPIN 13
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.println("Serial Test");
lcd.begin(16, 2);
// you can now interact with the LCD, e.g.:
lcd.print("Half-Fast");
lcd.setCursor(0,1);
lcd.print("Electronics");
delay(1000);
}
void loop() {
float temperature = dht.readTemperature();
temperature = dht.convertCtoF(temperature);
// Check if any reads failed and exit early (to try again).
if (isnan(temperature)) {
Serial.println(F("Failed to read from DHT sensor!"));
lcd.clear();
lcd.print("Failed to read ");
lcd.setCursor(0,1);
lcd.print("from DHT Sensor");
delay(1000);
return;
}
lcd.clear();
lcd.print("Air Temp: ");
lcd.print(temperature);
delay(1000);
}