ESP-S2 PWM for a Servo pulse
Posted: Mon Apr 12, 2021 5:51 pm
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.
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.