#include <LiquidCrystal.h>
#include "DHT.h"
#include <Servo.h>
DHT dht(2, DHT22);
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
Servo Myservo;
int pos = 0;
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
dht.begin();
Myservo.attach(5);
}
void loop()
{
delay(100);
float h = dht.readHumidity();
float t = dht.readTemperature();
lcd.setCursor(0,0);
lcd.print("Humidity:");
lcd.print(h);
lcd.print("%");
lcd.setCursor(0,1);
lcd.print("Temp:");
lcd.print((int)t);
lcd.print(" Celsius");
Myservo.write(pos);
if((t>30) || (h<70))
{pos = 90 ;}
else
{pos = 0 ;}
}