ALPHA_A
Dependencies: DataPool MD_PID mbed
main.cpp@3:42fdfd41f96a, 2017-09-07 (annotated)
- Committer:
- hirotayamato
- Date:
- Thu Sep 07 00:37:39 2017 +0000
- Revision:
- 3:42fdfd41f96a
- Parent:
- 1:3082e5f990cd
- Child:
- 4:169a7b6c0138
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 | 0:e77e7d7bbae0 | 8 | Mekanamu_4 Mekanamu(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 | 0:e77e7d7bbae0 | 16 | Mekanamu.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 | 0:e77e7d7bbae0 | 23 | Mekanamu.Drive(x, y, t); |
hirotayamato | 0:e77e7d7bbae0 | 24 | } |
hirotayamato | 0:e77e7d7bbae0 | 25 | } |