bio robot
Dependencies: MPU6050-DMP QEI_hw mbed-rpc mbed
Fork of MPU6050_Example by
Diff: main.cpp
- Revision:
- 4:ebb882658c50
- Parent:
- 3:be5cf450436d
- Child:
- 5:c3d671959ef3
diff -r be5cf450436d -r ebb882658c50 main.cpp --- a/main.cpp Thu Dec 03 03:01:37 2015 +0000 +++ b/main.cpp Thu Dec 03 03:14:00 2015 +0000 @@ -10,8 +10,6 @@ void ReadRange(Arguments* input, Reply* output); RPCFunction RangeFinder(&ReadRange, "RangeFinder"); -Serial pc(USBTX, USBRX); - Gains gains; Target target; @@ -20,24 +18,20 @@ Comm comm(&gains, &target, &myMPU6050_1); int main() { - char buf[256], outbuf[256]; + while(1) { myMPU6050_1.loop(); // comm.printTarget(); - - pc.gets(buf, 256); - //Call the static call method on the RPC class - RPC::call(buf, outbuf); - pc.printf("%s\n", outbuf); + comm.check(); } } void ReadRange(Arguments* input, Reply* output){ for (int i=0; i < input->argc; i++){ - pc.printf("argv[%1d] = %s \n",i,input->argv[i]); + comm._pc.printf("argv[%1d] = %s \n",i,input->argv[i]); } - pc.printf("amandaasdffasdfads"); + comm._pc.printf("serialdjfjsldkj"); //Format the output of the srf08 into the output string // sprintf(output, "%f", srf08.read()); }