Hi,
I need a 1Hz clock with its interrupt function.
Where do I find an example to set the timer RTC0 or RTC1 to 1Hz and how to set the timer callback function?
Thanks in advance
Hi,
I need a 1Hz clock with its interrupt function.
Where do I find an example to set the timer RTC0 or RTC1 to 1Hz and how to set the timer callback function?
Thanks in advance
Check out the sample in 3.5 Add the ADC peripheral, which provides a sample using a timer. As explained in this ticket, the timer will use RTC under the hood.
If you want the timer to trigger every second (1Hz), do the following:
k_timer_start(&my_timer, K_SECONDS(1), K_SECONDS(1));
Best regards,
Simon