ManualControl

Dependencies:   TPixy-Interface

Fork of MbedOS_Robot by ECE4333 - 2018 - Ahmed & Brandon

Revision:
15:cf67f83d5409
Parent:
11:9135e5bc2fcf
Child:
17:1184df616383
--- 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  
     }