bio robot

Dependencies:   MPU6050-DMP QEI_hw mbed-rpc mbed

Fork of MPU6050_Example by Shundo Kishi

Revision:
4:ebb882658c50
Parent:
2:17b18ea93551
Child:
5:c3d671959ef3
--- a/Comm/Comm.cpp	Thu Dec 03 03:01:37 2015 +0000
+++ b/Comm/Comm.cpp	Thu Dec 03 03:14:00 2015 +0000
@@ -1,7 +1,8 @@
 #include "Comm.h"
+#include "mbed_rpc.h"
 
     
-Comm::Comm(CommDelegate *gains, CommDelegate *target, CommDelegate *myMPU6050_1):_json(_pc)//_pc(USBTX, USBRX)
+Comm::Comm(CommDelegate *gains, CommDelegate *target, CommDelegate *myMPU6050_1):_pc(USBTX, USBRX), _json(&_pc)
 {
 //    _pc.baud(115200);
     _gains = gains;
@@ -73,15 +74,9 @@
     _json.close();
 }
 
-//void Comm::check(){
-//    if (newline_detected){
-//        printTarget();
-//    }
-//}
-//
-//void rxCallback(MODSERIAL_IRQ_INFO *q) {
-//    MODSERIAL *serial = q->serial;
-//    if ( serial->rxGetLastChar() == '\n') {
-//        newline_detected = true;
-//    }
-//}
+void Comm::check(){
+    _pc.gets(buf, 256);
+    //Call the static call method on the RPC class
+    RPC::call(buf, outbuf); 
+    _pc.printf("%s\n", outbuf);
+}