Question.2
Consider the following Arduino UNO code that uses the Watchdog Timer. What will be printed on the Serial Monitor?
#include <avr/wdt.h>
#include <avr/interrupt.h>
void setup() {
Serial.begin(115200);
delay(1000);
wdt_enable(WDTO_1S); // Enable watchdog timer with 1-second timeout
Serial.println("Watchdog Timer Initialized");
wdt_reset(); // Reset watchdog timer
sei(); // Enable global interrupts
Serial.println("System Setup Complete");
}
ISR(WDT_vect) {
Serial.println("Watchdog Interrupt Triggered");
}
void loop() {
Serial.println("Loop execution started");
delay(1200);
Serial.println("Loop execution completed");
wdt_reset(); // Reset watchdog timer
}