#include <ESP32Servo.h>
Servo servo;
const int pinPotentiometer = 34; // Pin al que está conectado el potenciómetro
const int pinServo = 14;
int potValue = 0;
int servoPos = 0;
void setup() {
servo.attach(pinServo);
}
void loop() {
potValue = analogRead(pinPotentiometer);
servoPos = map(potValue, 0, 4095, 0, 180);
servo.write(servoPos);
delay(100);
}