ALPHA_A
Dependencies: DataPool MD_PID mbed
main.cpp@4:169a7b6c0138, 2017-09-14 (annotated)
- Committer:
- hirotayamato
- Date:
- Thu Sep 14 00:36:55 2017 +0000
- Revision:
- 4:169a7b6c0138
- Parent:
- 3:42fdfd41f96a
- Child:
- 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 | 4:169a7b6c0138 | 8 | Mecanamu_4 Mecanamu(PA_8, PB_0, PA_2, 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 | 3:42fdfd41f96a | 20 | x = alpha->read(0) / 128; |
hirotayamato | 3:42fdfd41f96a | 21 | y = alpha->read(1) / 128; |
hirotayamato | 3:42fdfd41f96a | 22 | t = alpha->read(2) / 128; |
hirotayamato | 4:169a7b6c0138 | 23 | Mecanamu.Drive(x, y, t); |
hirotayamato | 0:e77e7d7bbae0 | 24 | } |
hirotayamato | 0:e77e7d7bbae0 | 25 | } |