#include <ESP32Servo.h>
const int servoPin = 27;
Servo servoMotor;
int posGraus = 0;
void setup() {
Serial.begin(115200);
servoMotor.attach(servoPin);
}
void loop() {
for (posGraus = 0; posGraus <= 180; posGraus ++){
Serial.println(posGraus);
servoMotor.write(posGraus);
delay(20);
}
for (posGraus = 180; posGraus >= 0; posGraus --){
Serial.println(posGraus);
servoMotor.write(posGraus);
delay(20);
}
}