#include <LiquidCrystal.h>
#include <Adafruit_Sensor.h>
#include "DHT.h"
#define DHTPIN 7
#define DHTTYPE DHT22
const int DHT_PIN=7;
DHT dht(DHTPIN,DHTTYPE);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(13, 12, 10, 17, 16, 15);
byte customChar[8] = {
B00000,
B00000,
B01010,
B00000,
B10001,
B01110,
B00000,
B00000
};
byte customChar1[8] = {
B00000,
B00000,
B01010,
B00000,
B10001,
B01110,
B00000,
B00000
};
void setup() {
lcd.createChar(0,customChar);
lcd.createChar(1,customChar1);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.write((byte)0);
lcd.write((byte)1);
Serial.begin(9600);
Serial.println("DHT22 TEST !");
dht.begin();
// Print a message to the LCD.
// lcd.print("RAMANUJ TIWARY");
// lcd.setCursor(0, 1);
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
delay(2000); // this speeds up the simulation
float h = dht.readHumidity();
float t=dht.readTemperature();
Serial.print("Humidity\t");
Serial.print(h);
Serial.print("%\n");
delay(500);
Serial.print("temperature: \t");
Serial.print(t);
Serial.print("*C\n");
lcd.setCursor(0,0);
lcd.print(t);
lcd.setCursor(0,1);
lcd.print(h);
}