/* Wap to interface DHT11 or any other temperature sensor, DC Motor, to
exhibit a real life situation that whenever temperature rises above a
threshold value the DC motor(representing fan) starts and when temperature
falls below a value, the motor stops.*/
void setup() {
// put your setup code here, to run once:
pinMode(4, OUTPUT);
pinMode(A4, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(analogRead((A4)>150)){
digitalWrite(4, HIGH);
}
else{
digitalWrite(4, LOW);
}
delay(100);
}