#include <LiquidCrystal.h>
#include <dht.h>
dht DHT;
LiquidCrystal lcd(12,11,10,9,8,7);
void setup() {
// put your setup code here, to run once:
lcd.begin(16,2);
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
//tesztprogram
/*
DHT.read22(A0);
int homerseklet=DHT.temperature;
lcd.clear();
lcd.print(homerseklet);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
*/
DHT.read22(A0);
lcd.clear();
lcd.print("homersek:");
int homerseklet=DHT.temperature;
lcd.print(homerseklet);
lcd.print("C");
lcd.setCursor(13,0);
lcd.println("20C");
lcd.setCursor(0,1);
lcd.print("Paratartalom:");
int par=DHT.humidity;
lcd.print(par);
lcd.println("%");
if(homerseklet<20)
{
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
}
else if (homerseklet>20)
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
}
delay(2000);
}