//Mengatur sudut servo berbasis input potensiometer
#include <ESP32Servo.h>
Servo myservo; // create servo object to control a servo
#define PinPot 35
int val = 0;
void setup() {
Serial.begin(115200);
myservo.attach(21);
pinMode(PinPot, INPUT);
}
void loop() {
val = analogRead(PinPot);
val = map(val, 0, 1023, 0, 180);
myservo.write(val);
delay(15);
}