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.
ledc_set_freq() calls 5 functions:
![]()
ledc_set_freq()
ledc_set_freq() reads 14 variables:
![]()
ledc_set_freq()