65. Interrupt Conditions

Question.3

Consider the following waveform is applied to pin 2 of Arduino UNO. Also, note that the waveform was applied only when the microcontroller had successfully loaded the code.

Code

#define INTERRUPT_PIN 2  // External Interrupt 0 (INT0)

void setup() {
    cli();  // Disable global interrupts

    // Configure INT0 (PD2) as input
    pinMode(2,INPUT_PULLUP);

    attachInterrupt(digitalPinToInterrupt(2), handleInterrupt, CHANGE);

    sei();  // Enable global interrupts
}

// ISR for INT0
ISR(INT0_vect) {
   interruptCount++;
}


void loop() {
    // Main code (runs continuously)
}

What will be the final value of the count variable after Point H?

Select Answer