ObjectFollower
Dependencies: TPixy-Interface
Fork of PlayBack by
Diff: main.cpp
- Revision:
- 15:cf67f83d5409
- Parent:
- 11:9135e5bc2fcf
- Child:
- 17:1184df616383
diff -r 5777377537a2 -r cf67f83d5409 main.cpp --- a/main.cpp Sat Mar 03 02:14:40 2018 +0000 +++ b/main.cpp Sat Mar 03 04:47:26 2018 +0000 @@ -12,6 +12,8 @@ #include "ExternalInterruptThread.h" #include "ui.h" #include "CameraThread.h" +#include "motor_driver_l.h" +#include "motor_driver_r.h" /******************************************************************************/ @@ -34,6 +36,14 @@ while(1) { + // if robot goes crazy press 'r' to kill it + if(killRobot == true) + { + osThreadTerminate(PiControlId); + motorDriver_L_stop(); + motorDriver_R_stop(); + } + consoleUI(); Thread::wait(500); // Go to sleep for 500 ms }