Open EinRainerZufall opened 1 year ago
Are there no way to support lower frequencies than 200 Hz on C3?
The library in v1.1.0 has a new parameter frequency
which user can use in the attach(...)
function and set it according to the ESP32 chip. Thank @mikaeltulldahl and his #23 PR.
Without that, we would need to add define for each new ESP32 chip, which is not such practical.
Now users can set the frequency like this:
Servo servo1;
const int servoPin = 4;
const int frequency = 200; // Hz
servo1.attach(
servoPin,
Servo::CHANNEL_NOT_ATTACHED,
Servo::DEFAULT_MIN_ANGLE,
Servo::DEFAULT_MAX_ANGLE,
Servo::DEFAULT_MIN_PULSE_WIDTH_US,
Servo::DEFAULT_MAX_PULSE_WIDTH_US,
frequency
);
@EinRainerZufall Let me know if you are ok with this solution, and we can close this PR.
The changes were only tested on a XIAO-ESP32-C3. This should solve problem #20 .
After some testing I found out that ledc only work down to 200Hz on the ESP32-C3.
I have also added the solution @h2zero in #18 for the bit deep