Non Blocking LED Blink Function
Posted: Wed Dec 07, 2022 6:28 pm
Hi All,
I am trying to build LED blinking functions at different speeds, to denote the connection status of the wifi. A simple while(1) like this :
however blocks the rest of the code, so I am unable to use that.
Is it possible to use the LEDC peripheral to make the LED blink at variable speeds and switch it on/off? Is there any example code for the same?
Thanks in advance!
I am trying to build LED blinking functions at different speeds, to denote the connection status of the wifi. A simple while(1) like this :
Code: Select all
void led_fast(){
ESP_LOGI(TAG, "LED FAST INITIATED");
while (1) {
gpio_set_level(LED,0);
vTaskDelay(500/portTICK_RATE_MS);
gpio_set_level(LED,1);
vTaskDelay(500/portTICK_RATE_MS);
}
}
Is it possible to use the LEDC peripheral to make the LED blink at variable speeds and switch it on/off? Is there any example code for the same?
Thanks in advance!