Hi,
I use one PWM servo motor MG90S (0-170 degrees) and if I turn on the ESP32-WROOM-32D, I will set 0 degrees without any problems, I will also set 170, but I always have to reset the GPIO25. The servo motor starts to rotate spontaneously. The GPIO25 is a PWM pin.
On ESP32 I use wifi for webserver, but it should connect to ADC2 and not to PWM, which should work.
I perform measurements only every 10 minutes and yet the 170 to 0 degree command did not work properly. It remained at 170 degrees.
I use this library: https://github.com/RoboticsBrno/ServoESP32
// servo ON
Serial.println("SERVO 170");
servo1.attach(SERVO_PIN, Servo::CHANNEL_NOT_ATTACHED, 0, 170);
for(int posDegrees = 0; posDegrees <= 170; posDegrees+=5) {
servo1.write(posDegrees);
Serial.println(posDegrees);
delay(10);
}
gpio_reset_pin(SERVO_PIN); // off PWM
// we measure
// servo OFF
servo1.attach(SERVO_PIN, Servo::CHANNEL_NOT_ATTACHED, 0, 170);
for(int posDegrees = 170; posDegrees >= 0; posDegrees-=5) {
servo1.write(posDegrees);
Serial.println(posDegrees);
delay(10);
}
gpio_reset_pin(SERVO_PIN); // vypneme PWM