Question.1
Consider the following Arduino UNO code that utilizes the Watchdog Timer.
What will be printed on the Serial Monitor?
Code
#include <avr/wdt.h>
void setup() {
Serial.begin(115200);
delay(1000);
wdt_enable(WDTO_2S); // Enable Watchdog Timer with a 2-second timeout
Serial.println("System started");
}
void loop() {
Serial.println("Loop iteration started");
delay(1500); // Simulating some task
Serial.println("Task completed");
delay(1000); // Another delay
wdt_reset(); // Reset watchdog timer
Serial.println("Watchdog Reset!");
}