Hi,
error file wdt.h - not atmega32u4 No work leonardo.
Where to get the right file? :o
// Arduino test watchdog
/* serial monitor output:
Setup..
Wait 5 sec..
Watchdog enabled.
1
2
3
4
5
6
7
8
9
10
Setup..
Wait 5 sec..
Watchdog enabled.
1
2
and so forth
*/
#include <avr/wdt.h>
void setup() { // flash led and serial monitor write
Serial.begin(115200);
Serial.println("Setup..");
Serial.println("Wait 5 sec..");
delay(5000); // timeout if bootloop
wdt_enable (WDTO_8S); // for test 8sec
Serial.println("Watchdog enabled.");
}
int timer = 0;
void loop(){ // flash led and serial monitor write
if(!(millis()%1000)){
timer++;
Serial.println(timer);
digitalWrite(13, digitalRead(13)==1?0:1); delay(1);
}
}