bio robot
Dependencies: MPU6050-DMP QEI_hw mbed-rpc mbed
Fork of MPU6050_Example by
main.cpp
- Committer:
- amandaghassaei
- Date:
- 2015-12-03
- Revision:
- 3:be5cf450436d
- Parent:
- 2:17b18ea93551
- Child:
- 4:ebb882658c50
File content as of revision 3:be5cf450436d:
#include "mbed.h" #include "mbed_rpc.h" #include "MyMPU6050.h" #include "Gains.h" #include "Target.h" #include "Comm.h" void ReadRange(Arguments* input, Reply* output); RPCFunction RangeFinder(&ReadRange, "RangeFinder"); Serial pc(USBTX, USBRX); Gains gains; Target target; MyMPU6050 myMPU6050_1(p9, p10);//I2C_SDA, I2C_SCL 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); } } void ReadRange(Arguments* input, Reply* output){ for (int i=0; i < input->argc; i++){ pc.printf("argv[%1d] = %s \n",i,input->argv[i]); } pc.printf("amandaasdffasdfads"); //Format the output of the srf08 into the output string // sprintf(output, "%f", srf08.read()); }