Zumy code for sending struct data

Dependencies:   MPU6050IMU QEI RPCInterface mbed

Fork of zumy_mbed by David McPherson

Files at this revision

API Documentation at this revision

Comitter:
jlamyi
Date:
Fri Feb 19 02:50:45 2016 +0000
Parent:
8:1e47a6b49537
Child:
10:089fa57a0a23
Commit message:
added debug mode

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Feb 17 03:45:51 2016 +0000
+++ b/main.cpp	Fri Feb 19 02:50:45 2016 +0000
@@ -3,10 +3,13 @@
 #include "MPU6050.h"
 #include "QEI.h"
 
+bool debug = true;
+if(debug) Serial pc(USBTX, USBRX); // tx, rx
+
 extern "C" void mbed_reset();
 
 SerialRPCInterface SerialRPC(USBTX, USBRX, 115200);
-//Serial pc(USBTX, USBRX); // tx, rx
+
 void GetSensorData(char* input, char* output);
 RPCFunction gsd(&GetSensorData, "gsd");
 void Reset(char* input, char* output);
@@ -60,7 +63,7 @@
         // Handle the encoders
         r_enc = r_wheel.getPulses();
         l_enc = l_wheel.getPulses();
-        //pc.printf("Pulses are: %i, %i\r\n", l_enc,r_enc);
+        if(debug) pc.printf("Pulses are: %i, %i\r\n", l_enc,r_enc);
         
         if (!(--loop_count)) {
             loop_count = 10;