car using PID from centre line

Dependencies:   FRDM-TFC mbed CBuffer XBEE mbed_angular_speed motor2 MMA8451Q

Fork of KL25Z_Camera_Test by GDP 4

Revision:
50:1cfe1f975b0c
Parent:
48:daa2a1900ada
Child:
51:6a84fbc404c8
--- a/main.cpp	Thu Apr 27 12:10:40 2017 +0000
+++ b/main.cpp	Thu Apr 27 15:51:01 2017 +0000
@@ -160,17 +160,32 @@
             switch(choice) {
                  case 0:
                      initPID(&servo_pid, 2.2f, 0.6f, 0.f);
+                     if(!torque){
                      speed = 40;
+                     }
+                     else{
+                        speed = 0.4;
+                     }
                      ed_tune = man_tuner;
                     break;
                 case 1:
                      initPID(&servo_pid, 2.2f, 0.6f, 0.f);
+                     if(!torque){
                      speed = 65;
+                     }
+                     else{
+                        speed = 0.6
+                     }
                      ed_tune = man_tuner;
                     break;
                 case 2:
                      initPID(&servo_pid, 2.2f, 0.6f, 0.f);
+                     if(!torque){
                      speed = 80;
+                     }
+                     else{
+                        speed= 0.8
+                     }
                      ed_tune = man_tuner;
                     break;
                 case 3: