Complete the code to initialize the input capture mode on Timer1.
TCCR1B = (1 << ICES1) | (1 << [1]);
The CS10 bit sets the clock prescaler to start the timer in input capture mode.
Complete the code to enable the input capture interrupt.
TIMSK1 |= (1 << [1]);
ICIE1 enables the input capture interrupt for Timer1.
Fix the error in the input capture ISR declaration.
ISR(TIMER1_[1]_vect) {
// Handle input capture event
}The correct ISR vector name for input capture on Timer1 is TIMER1_CAPT_vect.
Fill both blanks to configure input capture to trigger on falling edge and enable noise canceler.
TCCR1B = (0 << [1]) | (1 << [2]);
Setting ICES1 to 0 triggers on falling edge; setting ICNC1 to 1 enables noise canceler.
Fill all three blanks to read the input capture value, clear the flag, and start the timer with no prescaling.
uint16_t capture = ICR1; TIFR1 |= (1 << [1]); TCCR1B = (1 << [2]) | (0 << [3]);
ICF1 is the input capture flag to clear; CS10 starts timer with no prescaling; ICES1 selects edge.