madhephaestus / ESP32Servo

Arduino-compatible servo library for the ESP32
139 stars 55 forks source link

Update ESP32PWM.cpp: Set pin before first call to ledcAttach(getPin()… #65

Closed ArminJo closed 1 month ago

ArminJo commented 1 month ago

Otherwise you get: [ 7634][E][esp32-hal-periman.c:180] perimanGetPinBus(): Invalid pin: 255 [ 7641][E][esp32-hal-periman.c:122] perimanSetPinBus(): Invalid pin: 255 [ 7647][E][esp32-hal-ledc.c:116] ledcAttachChannel(): Pin 255 is already attached to another bus and failed to detach

ArminJo commented 1 month ago

If not setting pin, you get the initial pin number -1 == 255 with getPin() which leads to the error above.

ArminJo commented 1 month ago

Sorry, there is more to come