Basic implementation of watchdog

Dependencies:   ros_lib_kinetic

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include <ros.h>
00003 #include <nav_msgs/Odometry.h>  //contains both the twist and pose
00004 #include "Watchdog.h"
00005 
00006 int i = 1;
00007 
00008 Serial pc(USBTX, USBRX, 57600);     //Serial Monitor
00009 
00010 int main(void)
00011 {
00012     Watchdog dog;
00013     dog.Configure(1);
00014     pc.printf("I'm resetting!\n", dog.WatchdogCausedReset());
00015     
00016     while(i++)
00017     {
00018     pc.printf("Hello! I'm working! Iteration: %d \n", i);
00019     wait(0.9);
00020     
00021     if (i == 10) {
00022         wait(0.6);
00023     }
00024     
00025     
00026     dog.Service();
00027     //return 0;
00028     }
00029 }