Jugaadu was playing in the playground where he finds that his uncle from the neighbourhood was sitting sadly. Jugaadu went to him and enquired about the problems he was facing. He said to him that his son got his hands burnt by putting his hand in the hot water. He told Jugaadu that this is not for the first time, even his wife got burnt similarly. He has asked for Jugaadu's help. Can you help Uncle regarding the situation?
#include
#include
Servo myservo;
dht DHT;
int pos = 0;
int dhtPin = 8;
int chk;
float hum;
float temp;
void setup()
{pinMode(13,OUTPUT);
digitalWrite(13,HIGH);
myservo.attach(12);
Serial.begin(9600);
}
void loop()
{
DHT.read11(dhtPin);
hum = DHT.humidity;
temp= DHT.temperature;
Serial.println(temp);
if(temp>30){
myservo.write(180);
delay(1000);
}else{
myservo.write(0);
delay(1000);
}
}