ALPHA_A
Dependencies: DataPool MD_PID mbed
main.cpp@6:bb5e51ded250, 2017-09-15 (annotated)
- Committer:
- hirotayamato
- Date:
- Fri Sep 15 01:11:50 2017 +0000
- Revision:
- 6:bb5e51ded250
- Parent:
- 5:1142db72d16d
ALPHA_A
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hirotayamato | 0:e77e7d7bbae0 | 1 | #include "mbed.h" |
hirotayamato | 0:e77e7d7bbae0 | 2 | |
hirotayamato | 0:e77e7d7bbae0 | 3 | #include "2017_4.h" |
hirotayamato | 0:e77e7d7bbae0 | 4 | |
hirotayamato | 0:e77e7d7bbae0 | 5 | #include "AlphaTransporter.h" |
hirotayamato | 0:e77e7d7bbae0 | 6 | #include "DataPool.h" |
hirotayamato | 0:e77e7d7bbae0 | 7 | |
hirotayamato | 6:bb5e51ded250 | 8 | Mecanamu_4 Mecanamu(PA_8, PB_0, PA_12, PA_7, PA_11, PB_1, PA_6, PA_5, PB_5, PF_0, PA_4, PA_3, PB_4, PF_1, PA_1, PA_0, 1); |
hirotayamato | 0:e77e7d7bbae0 | 9 | Serial pc(USBTX, USBRX); |
hirotayamato | 0:e77e7d7bbae0 | 10 | |
hirotayamato | 0:e77e7d7bbae0 | 11 | int main() { |
hirotayamato | 0:e77e7d7bbae0 | 12 | DataPool *alpha; |
hirotayamato | 1:3082e5f990cd | 13 | |
hirotayamato | 0:e77e7d7bbae0 | 14 | alpha = new AlphaTransporter; |
hirotayamato | 1:3082e5f990cd | 15 | |
hirotayamato | 4:169a7b6c0138 | 16 | Mecanamu.Drive(0, 0, 0); |
hirotayamato | 0:e77e7d7bbae0 | 17 | float x, y, t; |
hirotayamato | 0:e77e7d7bbae0 | 18 | while(1) { |
hirotayamato | 0:e77e7d7bbae0 | 19 | alpha->set(); |
hirotayamato | 5:1142db72d16d | 20 | x = alpha->read(0) / 128.00; |
hirotayamato | 5:1142db72d16d | 21 | y = alpha->read(1) / 128.00; |
hirotayamato | 5:1142db72d16d | 22 | t = alpha->read(2) / 128.00; |
hirotayamato | 4:169a7b6c0138 | 23 | Mecanamu.Drive(x, y, t); |
hirotayamato | 6:bb5e51ded250 | 24 | wait(0.1); |
hirotayamato | 0:e77e7d7bbae0 | 25 | } |
hirotayamato | 0:e77e7d7bbae0 | 26 | } |