Arduino quickie: add a watch-dog to your application
This is a small hint, how to add a watch-dog to your Arduino application.
I’m using the Arduino in 24/7 mode in my weather station. For unknow reason the software sends no data to our host system, it got stucked somewhere. So I added the watch-dog to prevent this.
Adding this functionality is fairly simple.
- you need to include the wdt.h File:
- in the setup routine you add:
other values are also possible: 15 ms, 30 ms, 60 ms, 120 ms, 250 ms, 500 ms, 1 s, 2 s, 4 and 8 s.
- in the loop routine you add:
see also: http://tushev.org/articles/electronics/48-arduino-and-watchdog-timer for more information.
October 03, 2011