Complete the code to start the timer.
TIMER_START([1]);The function TIMER_START needs the timer name to start it. Here, timer1 is the correct timer identifier.
Complete the code to check if the timer has expired.
if ([1]_expired()) { // Timer expired actions }
The function to check if a timer expired is usually named with the timer's name followed by _expired(). Here, timer1_expired() is correct.
Fix the error in the timer initialization code.
void init_timer() {
[1] = 0;
TIMER_CONFIGURE(timer1, 1000);
}The variable timer1_count should be reset to zero to initialize the timer count properly.
Fill both blanks to create a delay using the timer.
while (![1]_expired()) { [2](); }
The loop waits until timer1_expired() returns true. Inside the loop, do_nothing() is called to avoid busy waiting.
Fill all three blanks to set up and start a timer with a callback.
void setup() {
[1] = 500;
TIMER_CONFIGURE(timer2, [2]);
TIMER_START([3]);
}The variable delay_ms is set to 500 milliseconds. Then TIMER_CONFIGURE uses delay_ms to set the timer period. Finally, TIMER_START(timer2) starts the timer.