Recall & Review
beginner
What is the purpose of the TimerOne library in Arduino?
The TimerOne library allows you to easily set up and use Timer1 on Arduino boards to create timer interrupts for precise timing tasks.
Click to reveal answer
beginner
How do you initialize TimerOne to trigger an interrupt every 1 second?
You use Timer1.initialize(1000000); where 1000000 is the time in microseconds (1 second).
Click to reveal answer
beginner
What function do you use to attach an interrupt service routine (ISR) with TimerOne?
You use Timer1.attachInterrupt(yourISR); where yourISR is the function called when the timer interrupt occurs.
Click to reveal answer
intermediate
Why should the code inside an ISR be kept short and fast?
Because the ISR blocks other code and interrupts, keeping it short prevents delays and keeps the program responsive.
Click to reveal answer
beginner
How do you stop TimerOne interrupts once they are running?
You call Timer1.detachInterrupt(); to stop the timer interrupt from firing.
Click to reveal answer
Which Timer does the TimerOne library control on Arduino boards?
✗ Incorrect
TimerOne library specifically controls Timer1 on Arduino boards.
What unit of time does Timer1.initialize() expect as its argument?
✗ Incorrect
Timer1.initialize() expects the time interval in microseconds.
What is the correct way to attach an interrupt function named blinkLED using TimerOne?
✗ Incorrect
The correct method is Timer1.attachInterrupt(yourFunction);
What happens if an ISR takes too long to execute?
✗ Incorrect
Long ISRs block other code and interrupts, causing delays.
How do you stop TimerOne interrupts once started?
✗ Incorrect
Timer1.detachInterrupt() stops the timer interrupt.
Explain how to set up a timer interrupt using the TimerOne library to toggle an LED every half second.
Think about initialize(), attachInterrupt(), and what code runs inside the ISR.
You got /4 concepts.
Describe why timer interrupts are useful in Arduino projects and how TimerOne simplifies their use.
Consider how interrupts help multitasking and timing.
You got /4 concepts.