Zumy code for sending struct data
Dependencies: MPU6050IMU QEI RPCInterface mbed
Fork of zumy_mbed by
Diff: main.cpp
- Revision:
- 9:6bff048c3b49
- Parent:
- 8:1e47a6b49537
- Child:
- 10:089fa57a0a23
diff -r 1e47a6b49537 -r 6bff048c3b49 main.cpp --- 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;