bio robot

Dependencies:   MPU6050-DMP QEI_hw mbed-rpc mbed

Fork of MPU6050_Example by Shundo Kishi

Committer:
amandaghassaei
Date:
Thu Dec 03 03:14:00 2015 +0000
Revision:
4:ebb882658c50
Parent:
3:be5cf450436d
Child:
5:c3d671959ef3
added pc back to comm object;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
amandaghassaei 3:be5cf450436d 1 #include "mbed.h"
amandaghassaei 3:be5cf450436d 2 #include "mbed_rpc.h"
syundo0730 0:8d2c753a96e7 3
amandaghassaei 2:17b18ea93551 4 #include "MyMPU6050.h"
amandaghassaei 2:17b18ea93551 5 #include "Gains.h"
amandaghassaei 2:17b18ea93551 6 #include "Target.h"
syundo0730 0:8d2c753a96e7 7
amandaghassaei 2:17b18ea93551 8 #include "Comm.h"
syundo0730 0:8d2c753a96e7 9
amandaghassaei 3:be5cf450436d 10 void ReadRange(Arguments* input, Reply* output);
amandaghassaei 3:be5cf450436d 11 RPCFunction RangeFinder(&ReadRange, "RangeFinder");
amandaghassaei 3:be5cf450436d 12
amandaghassaei 2:17b18ea93551 13 Gains gains;
amandaghassaei 2:17b18ea93551 14 Target target;
syundo0730 0:8d2c753a96e7 15
amandaghassaei 2:17b18ea93551 16 MyMPU6050 myMPU6050_1(p9, p10);//I2C_SDA, I2C_SCL
syundo0730 0:8d2c753a96e7 17
amandaghassaei 2:17b18ea93551 18 Comm comm(&gains, &target, &myMPU6050_1);
syundo0730 0:8d2c753a96e7 19
syundo0730 0:8d2c753a96e7 20 int main() {
amandaghassaei 4:ebb882658c50 21
syundo0730 0:8d2c753a96e7 22 while(1) {
amandaghassaei 2:17b18ea93551 23 myMPU6050_1.loop();
amandaghassaei 2:17b18ea93551 24 // comm.printTarget();
amandaghassaei 4:ebb882658c50 25 comm.check();
syundo0730 0:8d2c753a96e7 26 }
syundo0730 0:8d2c753a96e7 27 }
syundo0730 0:8d2c753a96e7 28
amandaghassaei 3:be5cf450436d 29 void ReadRange(Arguments* input, Reply* output){
amandaghassaei 3:be5cf450436d 30 for (int i=0; i < input->argc; i++){
amandaghassaei 4:ebb882658c50 31 comm._pc.printf("argv[%1d] = %s \n",i,input->argv[i]);
amandaghassaei 3:be5cf450436d 32 }
amandaghassaei 3:be5cf450436d 33
amandaghassaei 4:ebb882658c50 34 comm._pc.printf("serialdjfjsldkj");
amandaghassaei 3:be5cf450436d 35 //Format the output of the srf08 into the output string
amandaghassaei 3:be5cf450436d 36 // sprintf(output, "%f", srf08.read());
amandaghassaei 3:be5cf450436d 37 }
syundo0730 0:8d2c753a96e7 38