Is there an equivalent, for the ESP32-S2, to this command for a ESP32;
ledcSetup(PWMChannel, PWMFreq, PWMResolution);
Where PWMFreq would be the frequency\rate of the PWM pulse, which for a mecahnical servo you would normally set to 50hz.
The command above does work, I get a pulse and can vary the width correctly as needed, but the frequency of the pulse is way wrong, a value of 50 for PWMFreq gives a pulse frequency of around 5khz, and a value of 1, gives a pulse frequency of circa 300hz.
ESP-S2 PWM for a Servo pulse
-
- Posts: 829
- Joined: Mon Jul 22, 2019 3:20 pm
Re: ESP-S2 PWM for a Servo pulse
Please submit issues with the code at https://github.com/espressif/arduino-esp32/issues so they can be fixed. This forum is for more general questions. Note that ledcSetup should return the frequency it set, so you can verify.
-
- Posts: 14
- Joined: Sat Nov 28, 2020 11:05 am
Who is online
Users browsing this forum: No registered users and 100 guests