#include <DHT.h>
#define DHTPIN 7
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
float temp;
#include <Servo.h>
Servo servo;
int angle = 0;
void setup() {
//setup for the tempriture moniter
Serial.begin(9600);
dht.begin();
pinMode(13, OUTPUT);
//setup for the servo moter
servo.attach(5); //attachin to pin 5
servo.write(angle); //writing the intiol value of the angle to the moter
}
void loop() {
int temp = dht.readTemperature(); //reading the temp form the temp monitor
int angle = 180; //
Serial.print("Temp: ");
Serial.print(temp);
Serial.println(" Celcius");
angle = (40 + temp) * 1.5;
servo.write(angle);
delay(1000); //one second delay
}