ledc_fade_start() function
Start LEDC fading.
Arguments
speed_mode
Select the LEDC channel group with specified speed mode. Note that not all targets support high speed mode.
channel
LEDC channel number
fade_mode
Whether to block until fading done. See ledc_types.h ledc_fade_mode_t for more info. Note that this function will not return until fading to the target duty if LEDC_FADE_WAIT_DONE mode is selected.
Return value
- ESP_OK Success - ESP_ERR_INVALID_STATE Channel not initialized or fade function not installed. - ESP_ERR_INVALID_ARG Parameter error.
Notes
Call ledc_fade_func_install() once before calling this function. Call this API right after ledc_set_fade_with_time or ledc_set_fade_with_step before to start fading. Starting fade operation with this API is not thread-safe, use with care. For ESP32, hardware does not support any duty change while a fade operation is running in progress on that channel. Other duty operations will have to wait until the fade operation has finished.
ledc_fade_start() calls 4 functions:
![]()
ledc_fade_start()
ledc_fade_start() reads 12 variables:
![]()
ledc_fade_start()