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:
FatCookies
Date:
Mon Nov 21 16:57:53 2016 +0000
Parent:
10:1bd0224093e4
Child:
12:da96e2f87465
Commit message:
added hall sensor sending to jabba

Changed in this revision

main.cpp 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	Wed Nov 16 16:31:46 2016 +0000
+++ b/main.cpp	Mon Nov 21 16:57:53 2016 +0000
@@ -169,11 +169,29 @@
             pc.putc((int8_t)(TFC_LineScanImage0[i] >> 4) & 0xFF);    
         }
         
+
+    }
+    frame_counter++;
+    
         wL=Get_Speed(Time_L);
         wR=Get_Speed(Time_R);
-        sendString("wL = %f, wR = %f",wL,wR);
-    }
-    frame_counter++;
+        
+        union {
+            float a;
+            unsigned char bytes[4];
+        } thing;
+        
+        pc.putc('B');
+        thing.a = wL;
+        pc.putc(thing.bytes[0]);
+        pc.putc(thing.bytes[1]);
+        pc.putc(thing.bytes[2]);
+        pc.putc(thing.bytes[3]);
+        thing.a = wR;
+        pc.putc(thing.bytes[0]);
+        pc.putc(thing.bytes[1]);
+        pc.putc(thing.bytes[2]);
+        pc.putc(thing.bytes[3]);
 }
 
 inline void handleComms() {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/motor2.lib	Mon Nov 21 16:57:53 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/GDP-4/code/motor2/#b4346ef9fa04