#include <ESP32Servo.h>
const int servoPin = 27;
Servo servoMotor;
int posGraus= 0;
int pot = 34;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
servoMotor.attach(servoPin);
pinMode(pot, INPUT);
}
void loop() {
int L1 = analogRead(pot);
float x = map(L1, 0, 4095, 0, 180);
servoMotor.write(x);
}