77. Sleep Modes Operation

Question.2

After executing the following code on Arduino UNO, what will be printed on the Serial monitor?

Code

#include <avr/sleep.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>

ISR(WDT_vect) {
  // Empty ISR to handle the watchdog interrupt
}

void setup() {
  Serial.begin(115200);
  Serial.println("setup");
  delay(10);
}

void loop() {
  wdt_enable(WDTO_4S);
  WDTCSR |= (1 << WDIE);
 
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);
  sleep_enable();
  sleep_mode();
  Serial.println("loop");
  delay(10);
}

Select Answer