Question.2
Which of the following options is true when the button is pressed and released instantly? (After executing the following code on an Arduino UNO)
Code
#include <avr/power.h>
#define SWITCH_PIN 2
#define LED_PIN 13 //onboard LED
void switchPressHandler(){
clock_prescale_set(clock_div_16);
}
void setup() {
pinMode(13, OUTPUT);
pinMode(SWITCH_PIN, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(SWITCH_PIN), switchPressHandler, FALLING);
}
void loop() {
digitalWrite(LED_PIN,HIGH);
delay(100);
digitalWrite(LED_PIN,LOW);
delay(100);
}