Heartbeat
Within the main
control software, there is an endless loop (apart from when a shutdown or reboot command is received). Within this loop there are a whole load of checks, communications tasks and other things going on. At the end of this software loop is a bit of code to toggle one of the
I/O board outputs, to show that the software is working as planned. If a software or hardware error should occur, that slows or stops this loop, the heartbeat also slows or stops.
Initially, this output pin simply drives an LED on the outside of the robot, so that I can get a visual indication that all is well. Later on, I will add some hardware onto this pin, which expects to see the heartbeat at regular intervals and will take action if it is not seen (e.g. force a processor reboot).