#include<ESP32Servo.h>
Servo myservo;
int angle = 0;
void setup()
{
myservo.attach(4,544,2400);
Serial.begin(115200);
}
void loop()
{
for(angle = 0; angle < 180; angle += 1)
{
myservo.write(angle);
delay(20);
}
for(angle = 180; angle >= 1; angle -= 1)
{
myservo.write(angle);
delay(20);
Serial.print("angle: ");
Serial.println(angle);
}
}