#include <DHT.h>
#include <Servo.h>
#define DHT_INT 3
#define DHT_EXT 4
#define SERVO_PIN 11
#define LEDV 10
#define LEDJ 9
#define LEDR 8
int position =0;
DHT dht(DHT_INT,DHT_EXT);
//declaring servo
Servo window;
void setup() {
Serial.begin(9600);
pinMode(LEDV, OUTPUT);
pinMode(LEDV, OUTPUT);
pinMode(LEDV, OUTPUT);
//activate the dht
dht.begin();
//activate the servo
window.attach(SERVO_PIN);
}
void loop() {
float tempint = dht.readTemperature();
//reading temperature : default is celcius
float tempext = dht.readTemperature();
if(tempint >= 39){
digitalWrite(LEDV, HIGH);
}else if (tempext <= 20){
digitalWrite(LEDR, HIGH);
}
}