![](/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@7:7efcd3bf3302, 2015-12-03 (annotated)
- Committer:
- amandaghassaei
- Date:
- Thu Dec 03 06:09:28 2015 +0000
- Revision:
- 7:7efcd3bf3302
- Parent:
- 6:12b6be801ad8
- Child:
- 8:1a3a69fecedf
controls class started
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
amandaghassaei | 3:be5cf450436d | 1 | #include "mbed.h" |
amandaghassaei | 7:7efcd3bf3302 | 2 | #include "mbed_rpc.h" |
amandaghassaei | 2:17b18ea93551 | 3 | #include "Comm.h" |
amandaghassaei | 7:7efcd3bf3302 | 4 | #include "Controls.h" |
amandaghassaei | 3:be5cf450436d | 5 | |
amandaghassaei | 7:7efcd3bf3302 | 6 | Controls controls; |
amandaghassaei | 7:7efcd3bf3302 | 7 | Comm comm(&(controls.gains), &(controls.target), &(controls.myMPU6050_1)); |
syundo0730 | 0:8d2c753a96e7 | 8 | |
amandaghassaei | 6:12b6be801ad8 | 9 | int main() { |
amandaghassaei | 6:12b6be801ad8 | 10 | |
amandaghassaei | 6:12b6be801ad8 | 11 | while(1) { |
amandaghassaei | 7:7efcd3bf3302 | 12 | controls.loop(); |
amandaghassaei | 6:12b6be801ad8 | 13 | comm.check(); |
amandaghassaei | 6:12b6be801ad8 | 14 | comm.printPosition(); |
amandaghassaei | 6:12b6be801ad8 | 15 | } |
amandaghassaei | 6:12b6be801ad8 | 16 | } |
amandaghassaei | 6:12b6be801ad8 | 17 | |
amandaghassaei | 6:12b6be801ad8 | 18 | |
amandaghassaei | 6:12b6be801ad8 | 19 | //wrappers for comm stack |
amandaghassaei | 5:c3d671959ef3 | 20 | void openGripper1Wrapper(Arguments * input, Reply * output){ |
amandaghassaei | 5:c3d671959ef3 | 21 | comm.openGripper1(input, output); |
amandaghassaei | 5:c3d671959ef3 | 22 | }; |
amandaghassaei | 5:c3d671959ef3 | 23 | RPCFunction OpenGripper1(&openGripper1Wrapper, "OpenGripper1"); |
amandaghassaei | 5:c3d671959ef3 | 24 | void closeGripper1Wrapper(Arguments * input, Reply * output){ |
amandaghassaei | 5:c3d671959ef3 | 25 | comm.closeGripper1(input, output); |
amandaghassaei | 5:c3d671959ef3 | 26 | }; |
amandaghassaei | 5:c3d671959ef3 | 27 | RPCFunction CloseGripper1(&closeGripper1Wrapper, "CloseGripper1"); |
amandaghassaei | 5:c3d671959ef3 | 28 | void openGripper2Wrapper(Arguments * input, Reply * output){ |
amandaghassaei | 5:c3d671959ef3 | 29 | comm.openGripper2(input, output); |
amandaghassaei | 5:c3d671959ef3 | 30 | }; |
amandaghassaei | 5:c3d671959ef3 | 31 | RPCFunction OpenGripper2(&openGripper2Wrapper, "OpenGripper2"); |
amandaghassaei | 5:c3d671959ef3 | 32 | void closeGripper2Wrapper(Arguments * input, Reply * output){ |
amandaghassaei | 5:c3d671959ef3 | 33 | comm.closeGripper2(input, output); |
amandaghassaei | 5:c3d671959ef3 | 34 | }; |
amandaghassaei | 5:c3d671959ef3 | 35 | RPCFunction CloseGripper2(&closeGripper2Wrapper, "CloseGripper2"); |
amandaghassaei | 5:c3d671959ef3 | 36 | void setGains(Arguments * input, Reply * output){ |
amandaghassaei | 5:c3d671959ef3 | 37 | comm.setGains(input, output); |
amandaghassaei | 5:c3d671959ef3 | 38 | }; |
amandaghassaei | 5:c3d671959ef3 | 39 | RPCFunction SetGains(&setGains, "SetGains"); |
amandaghassaei | 5:c3d671959ef3 | 40 | void setTarget(Arguments * input, Reply * output){ |
amandaghassaei | 5:c3d671959ef3 | 41 | comm.setTarget(input, output); |
amandaghassaei | 5:c3d671959ef3 | 42 | }; |
amandaghassaei | 5:c3d671959ef3 | 43 | RPCFunction SetTarget(&setTarget, "SetTarget"); |
amandaghassaei | 5:c3d671959ef3 | 44 | |
amandaghassaei | 5:c3d671959ef3 | 45 | |
amandaghassaei | 5:c3d671959ef3 | 46 | |
amandaghassaei | 5:c3d671959ef3 | 47 | |
syundo0730 | 0:8d2c753a96e7 | 48 |