#include <ESP32Servo.h>
Servo myservo;
int pos;
int potpin = 34;
void setup(){
myservo.attach(21);
Serial.begin(115200);
}
void loop(){
Serial.print("pos: ");
Serial.println(pos);
pos = analogRead(potpin);
map(potpin, 0, 1023, 0, 180);
myservo.write(pos);
delay(1000);
}