![](/media/cache/group/logo_lbuWYaA.png.50x50_q85.png)
Basic implementation of watchdog
Dependencies: STM_ResetSupervisor USBDevice
Diff: main.cpp
- Revision:
- 1:38b385f34687
- Parent:
- 0:975e02a70882
- Child:
- 2:50b1371247da
--- a/main.cpp Tue Jun 25 23:31:34 2019 +0000 +++ b/main.cpp Tue Jun 25 23:49:40 2019 +0000 @@ -3,6 +3,7 @@ #include <nav_msgs/Odometry.h> //contains both the twist and pose #include "Watchdog.h" +int i = 1; Serial pc(USBTX, USBRX, 57600); //Serial Monitor @@ -10,12 +11,18 @@ { Watchdog dog; dog.Configure(1); - pc.print("is it caused ",dog.WatchdogCausedReset()); + pc.printf("I'm resetting!\n", dog.WatchdogCausedReset()); - while(1) + while(i++) { - pc.printf("hello \r\n"); - wait(1.6); + pc.printf("Hello! I'm working! Iteration: %d \n", i); + wait(0.9); + + if (i == 10) { + wait(0.6); + } + + dog.Service(); //return 0; }