Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DataPool MD_PID mbed
main.cpp@7:9eb4edae11c9, 2017-09-07 (annotated)
- Committer:
- hirotayamato
- Date:
- Thu Sep 07 00:42:39 2017 +0000
- Revision:
- 7:9eb4edae11c9
- Parent:
- 3:15f75374bff5
- Child:
- 8:c2569e1c34d7
BETA_A
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| hirotayamato | 0:b8fa7a019f5d | 1 | #include "mbed.h" |
| hirotayamato | 0:b8fa7a019f5d | 2 | |
| hirotayamato | 0:b8fa7a019f5d | 3 | #include "2017_3_h.h" |
| hirotayamato | 0:b8fa7a019f5d | 4 | |
| hirotayamato | 2:cd4c1d0a4346 | 5 | #include "BetaTransporter.h" |
| hirotayamato | 0:b8fa7a019f5d | 6 | #include "DataPool.h" |
| hirotayamato | 0:b8fa7a019f5d | 7 | |
| hirotayamato | 3:15f75374bff5 | 8 | Omni_3 Omni(PB_4, PB_0, PA_7, PA_2, PB_5, PB_1, PA_5, PA_6, PA_11, PF_0, PA_4, PA_3, 1); |
| hirotayamato | 0:b8fa7a019f5d | 9 | Serial pc(USBTX, USBRX); |
| hirotayamato | 0:b8fa7a019f5d | 10 | |
| hirotayamato | 0:b8fa7a019f5d | 11 | int main() { |
| hirotayamato | 2:cd4c1d0a4346 | 12 | DataPool *beta; |
| hirotayamato | 0:b8fa7a019f5d | 13 | |
| hirotayamato | 2:cd4c1d0a4346 | 14 | beta = new BetaTransporter; |
| hirotayamato | 0:b8fa7a019f5d | 15 | |
| hirotayamato | 0:b8fa7a019f5d | 16 | Omni.Drive(0, 0, 0); |
| hirotayamato | 0:b8fa7a019f5d | 17 | float x, y, t; |
| hirotayamato | 0:b8fa7a019f5d | 18 | while(1) { |
| hirotayamato | 2:cd4c1d0a4346 | 19 | beta->set(); |
| hirotayamato | 7:9eb4edae11c9 | 20 | x = beta->read(0) / 128; |
| hirotayamato | 7:9eb4edae11c9 | 21 | y = beta->read(1) / 128; |
| hirotayamato | 7:9eb4edae11c9 | 22 | t = beta->read(2) / 128; |
| hirotayamato | 0:b8fa7a019f5d | 23 | Omni.Drive(x, y, t); |
| hirotayamato | 0:b8fa7a019f5d | 24 | } |
| hirotayamato | 0:b8fa7a019f5d | 25 | } |