#include <ESP32Servo.h>
int servopin = 2;
Servo servo1;
int awal = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(servopin, OUTPUT);
servo1.attach(servopin);
servo1.write(awal);
int angka = 10;
if (angka <= 10){
servo1.write(180);
}
else {
servo1.write(awal);
}
while (angka < 5);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}