Quote:
Originally Posted by Ian McShane
Can someone give me a brief overview on what watchdogs are? what they do and how they work.
|
A simple explanation is a watchdog is a protection in the software to be sure your code doesn't take too much time to execute. One example that may cause this is if your code gets stuck in an infinite loop.
How does this protect your robot (and protect you from getting hurt)?
Let's say you command your drive motors to full power. Then let's say your code gets stuck in an infinite loop somewhere. In this situation, your motors would be at full power forever and your robot would crash into something, which is bad. Since you aren't feeding the watchdog during the infinite loop, eventually the watchdog would time-out, killing the power to your motors.
Basically, the watchdog is protection in your code to kill your motors if something goes wrong in your code.