#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <ESP32Servo.h>
#include <DHT.h>
DHT dht(33, DHT22);
Servo myservo;
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 64, &Wire);
int led = 4;
int pirdata =14;
int pirstate = LOW;
int value = 0;
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
Serial.begin(115200);
pinMode(led, OUTPUT);
pinMode(pirdata, INPUT);
myservo.attach(19);
myservo.attach(18);
myservo.attach(5);
myservo.attach(17);
myservo.write(0);
}
void loop() {
float temp_f = dht.readTemperature(true);
if(temp_f>30){
myservo.write(0);
delay(500);
myservo.write(180);
}
}