Code: Select all
static void ring()
{
ledc_set_duty(ledc_channel.speed_mode, ledc_channel.channel, 120);
ledc_update_duty(ledc_channel.speed_mode, ledc_channel.channel);
}
static void silent()
{
ledc_set_duty(ledc_channel.speed_mode, ledc_channel.channel, 0);
ledc_update_duty(ledc_channel.speed_mode, ledc_channel.channel);
}
static void buz_task()
{
while (true)
{
ring();
vTaskDelay(200 / portTICK_PERIOD_MS);
silent();
vTaskDelay(100 / portTICK_PERIOD_MS);
}
}
Thanks