![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
bio robot
Dependencies: MPU6050-DMP QEI_hw mbed-rpc mbed
Fork of MPU6050_Example by
main.cpp@6:12b6be801ad8, 2015-12-03 (annotated)
- Committer:
- amandaghassaei
- Date:
- Thu Dec 03 05:52:55 2015 +0000
- Revision:
- 6:12b6be801ad8
- Parent:
- 5:c3d671959ef3
- Child:
- 7:7efcd3bf3302
comm stack stop pt for now
Who changed what in which revision?
User | Revision | Line number | New 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" |
amandaghassaei | 5:c3d671959ef3 | 9 | //#include "CommWrapper.h" |
amandaghassaei | 3:be5cf450436d | 10 | |
amandaghassaei | 2:17b18ea93551 | 11 | Gains gains; |
amandaghassaei | 2:17b18ea93551 | 12 | Target target; |
amandaghassaei | 2:17b18ea93551 | 13 | MyMPU6050 myMPU6050_1(p9, p10);//I2C_SDA, I2C_SCL |
syundo0730 | 0:8d2c753a96e7 | 14 | |
amandaghassaei | 2:17b18ea93551 | 15 | Comm comm(&gains, &target, &myMPU6050_1); |
syundo0730 | 0:8d2c753a96e7 | 16 | |
amandaghassaei | 6:12b6be801ad8 | 17 | int main() { |
amandaghassaei | 6:12b6be801ad8 | 18 | |
amandaghassaei | 6:12b6be801ad8 | 19 | while(1) { |
amandaghassaei | 6:12b6be801ad8 | 20 | myMPU6050_1.loop(); |
amandaghassaei | 6:12b6be801ad8 | 21 | comm.check(); |
amandaghassaei | 6:12b6be801ad8 | 22 | comm.printPosition(); |
amandaghassaei | 6:12b6be801ad8 | 23 | } |
amandaghassaei | 6:12b6be801ad8 | 24 | } |
amandaghassaei | 6:12b6be801ad8 | 25 | |
amandaghassaei | 6:12b6be801ad8 | 26 | |
amandaghassaei | 6:12b6be801ad8 | 27 | //wrappers for comm stack |
amandaghassaei | 5:c3d671959ef3 | 28 | void openGripper1Wrapper(Arguments * input, Reply * output){ |
amandaghassaei | 5:c3d671959ef3 | 29 | comm.openGripper1(input, output); |
amandaghassaei | 5:c3d671959ef3 | 30 | }; |
amandaghassaei | 5:c3d671959ef3 | 31 | RPCFunction OpenGripper1(&openGripper1Wrapper, "OpenGripper1"); |
amandaghassaei | 5:c3d671959ef3 | 32 | void closeGripper1Wrapper(Arguments * input, Reply * output){ |
amandaghassaei | 5:c3d671959ef3 | 33 | comm.closeGripper1(input, output); |
amandaghassaei | 5:c3d671959ef3 | 34 | }; |
amandaghassaei | 5:c3d671959ef3 | 35 | RPCFunction CloseGripper1(&closeGripper1Wrapper, "CloseGripper1"); |
amandaghassaei | 5:c3d671959ef3 | 36 | void openGripper2Wrapper(Arguments * input, Reply * output){ |
amandaghassaei | 5:c3d671959ef3 | 37 | comm.openGripper2(input, output); |
amandaghassaei | 5:c3d671959ef3 | 38 | }; |
amandaghassaei | 5:c3d671959ef3 | 39 | RPCFunction OpenGripper2(&openGripper2Wrapper, "OpenGripper2"); |
amandaghassaei | 5:c3d671959ef3 | 40 | void closeGripper2Wrapper(Arguments * input, Reply * output){ |
amandaghassaei | 5:c3d671959ef3 | 41 | comm.closeGripper2(input, output); |
amandaghassaei | 5:c3d671959ef3 | 42 | }; |
amandaghassaei | 5:c3d671959ef3 | 43 | RPCFunction CloseGripper2(&closeGripper2Wrapper, "CloseGripper2"); |
amandaghassaei | 5:c3d671959ef3 | 44 | void setGains(Arguments * input, Reply * output){ |
amandaghassaei | 5:c3d671959ef3 | 45 | comm.setGains(input, output); |
amandaghassaei | 5:c3d671959ef3 | 46 | }; |
amandaghassaei | 5:c3d671959ef3 | 47 | RPCFunction SetGains(&setGains, "SetGains"); |
amandaghassaei | 5:c3d671959ef3 | 48 | void setTarget(Arguments * input, Reply * output){ |
amandaghassaei | 5:c3d671959ef3 | 49 | comm.setTarget(input, output); |
amandaghassaei | 5:c3d671959ef3 | 50 | }; |
amandaghassaei | 5:c3d671959ef3 | 51 | RPCFunction SetTarget(&setTarget, "SetTarget"); |
amandaghassaei | 5:c3d671959ef3 | 52 | |
amandaghassaei | 5:c3d671959ef3 | 53 | |
amandaghassaei | 5:c3d671959ef3 | 54 | |
amandaghassaei | 5:c3d671959ef3 | 55 | |
syundo0730 | 0:8d2c753a96e7 | 56 |