GDP 4 / Mbed 2 deprecated pid-car-example

Dependencies:   FRDM-TFC mbed CBuffer XBEE mbed_angular_speed motor2 MMA8451Q

Fork of KL25Z_Camera_Test by GDP 4

Files at this revision

API Documentation at this revision

Comitter:
lh14g13
Date:
Thu Apr 27 15:58:18 2017 +0000
Parent:
50:1cfe1f975b0c
Child:
52:af17b1a330f4
Commit message:
fixed error

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
main.h Show annotated file Show diff for this revision Revisions of this file
motor2.lib Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Apr 27 15:51:01 2017 +0000
+++ b/main.cpp	Thu Apr 27 15:58:18 2017 +0000
@@ -174,7 +174,7 @@
                      speed = 65;
                      }
                      else{
-                        speed = 0.6
+                        speed = 0.6;
                      }
                      ed_tune = man_tuner;
                     break;
@@ -184,7 +184,7 @@
                      speed = 80;
                      }
                      else{
-                        speed= 0.8
+                        speed= 0.8;
                      }
                      ed_tune = man_tuner;
                     break;
@@ -427,7 +427,7 @@
     t.start();
     handlePID(&servo_pid);
     //enables the ED
-    sensorCorner(left_motor_pid.desired_value,right_motor_pid.desired_value, servo_pid.output,speed,ed_tune);
+    //sensorCorner(left_motor_pid.desired_value,right_motor_pid.desired_value, servo_pid.output,speed,ed_tune);
     handlePID(&left_motor_pid);
     handlePID(&right_motor_pid);
 
@@ -470,9 +470,12 @@
     if(right_motor_pid.output < 0.0f) {
         right_motor_pid.output = 0.0f;
     }
-    
+    if(!torque){
     TFC_SetMotorPWM(left_motor_pid.output,right_motor_pid.output);
-    
+    }
+    else{
+        dutyCycleCorner(speed,servo_pid.output);
+    }
     t.stop();
     t.reset();
     t.start();
--- a/main.h	Thu Apr 27 15:51:01 2017 +0000
+++ b/main.h	Thu Apr 27 15:58:18 2017 +0000
@@ -128,10 +128,11 @@
 
 float oldTime;
 int lapNo;
-bool torque = 1;
+
 //Accelerometer:
 float checkAcc();
 float accTheshold=0.4;
+bool torque = 1;
  float man_tuner = 1.0f ;
 #if   defined (TARGET_KL25Z) || defined (TARGET_KL46Z)
   PinName const SDA = PTE25;
--- a/motor2.lib	Thu Apr 27 15:51:01 2017 +0000
+++ b/motor2.lib	Thu Apr 27 15:58:18 2017 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/GDP-4/code/motor2/#fec835dfd43a
+http://developer.mbed.org/teams/GDP-4/code/motor2/#2ba3e590f46a