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 10:24:51 2017 +0000
Parent:
47:6a58dcef714f
Child:
49:0d4ad8dc265b
Commit message:
added variable for accelerometer threshold.; also change accelerometer reading from y to z

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 07:40:02 2017 +0000
+++ b/main.cpp	Thu Apr 27 10:24:51 2017 +0000
@@ -80,7 +80,7 @@
                 accc = checkAcc();
             }
             
-            if(accc < 0.25f) {
+            if(accc < accTheshold) {
                 handleStartStop(); 
             } else {    
                 //sendString("up %f", accc);    
@@ -501,7 +501,7 @@
 }
 
 float checkAcc() {
-    return abs(acc.getAccY());   
+    return abs(acc.getAccZ());   
 }
 
 
--- a/main.h	Thu Apr 27 07:40:02 2017 +0000
+++ b/main.h	Thu Apr 27 10:24:51 2017 +0000
@@ -131,6 +131,7 @@
 
 //Accelerometer:
 float checkAcc();
+float accTheshold=0.4;
  float man_tuner = 1.0f ;
 #if   defined (TARGET_KL25Z) || defined (TARGET_KL46Z)
   PinName const SDA = PTE25;
--- a/motor2.lib	Thu Apr 27 07:40:02 2017 +0000
+++ b/motor2.lib	Thu Apr 27 10:24:51 2017 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/GDP-4/code/motor2/#80c4ce51cbe4
+http://developer.mbed.org/teams/GDP-4/code/motor2/#9384715df1b8