Select the LEDC channel group with specified speed mode. Note that not all targets support high speed mode.
channel
LEDC channel index (0 - LEDC_CHANNEL_MAX-1), select from ledc_channel_t
target_duty
Target duty of fading [0, (2**duty_resolution)]
max_fade_time_ms
The maximum time of the fading ( ms ).
fade_mode
choose blocking or non-blocking mode
Return value
- ESP_OK Success - ESP_ERR_INVALID_ARG Parameter error - ESP_ERR_INVALID_STATE Channel not initialized - ESP_FAIL Fade function init error
Notes
Call ledc_fade_func_install() once, before calling this function. 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.
Examples
ledc_set_fade_time_and_start() is referenced by 6 libraries and example projects: