65. Interrupt Conditions

Question.6

After uploading and executing  the code below on an Arduino UNO, apply the given digital signal to PIN 2 (External Interrupt INT0). What will be the final updated value of the counter variable after the signal is applied?

Code

volatile unsigned long counter = 0;

void setup() {
  pinMode(2, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(2), incrementCounter, RISING);
}

void loop() { 
}

void incrementCounter() {
  counter++;
}

Digital Signal

Select Answer