ledc_set_freq() function
LEDC set channel frequency (Hz)
Arguments
speed_mode
Select the LEDC channel group with specified speed mode. Note that not all targets support high speed mode.
timer_num
LEDC timer index (0-3), select from ledc_timer_t
freq_hz
Set the LEDC frequency
Return value
- ESP_OK Success - ESP_ERR_INVALID_ARG Parameter error - ESP_FAIL Can not find a proper pre-divider number base on the given frequency and the current duty_resolution.