#include <ESP32Servo.h>
#define ServoPin 32
#define PotPin 14
Servo Servo1;
int Value;
void setup()
{
Serial.begin(115200);
Servo1.attach(ServoPin);
pinMode(PotPin, INPUT);
}
void loop()
{
Value = analogRead(PotPin);
Value = map(Value, 0, 4095, 0, 180);
Servo1.write(Value);
delay(20);
}