Shinichiro Nakamura
/
ChoroQ_TestProgram
A test program for ChoroQ library.
main.cpp@2:2acbc2d1a208, 2010-10-13 (annotated)
- Committer:
- shintamainjp
- Date:
- Wed Oct 13 10:47:41 2010 +0000
- Revision:
- 2:2acbc2d1a208
- Parent:
- 1:adcec9a96e89
First version.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shintamainjp | 0:e9d9b1128e77 | 1 | /** |
shintamainjp | 0:e9d9b1128e77 | 2 | * A test program for CHORO Q HYBRID control class (Version 0.0.1) |
shintamainjp | 0:e9d9b1128e77 | 3 | * |
shintamainjp | 0:e9d9b1128e77 | 4 | * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems) |
shintamainjp | 0:e9d9b1128e77 | 5 | * http://shinta.main.jp/ |
shintamainjp | 0:e9d9b1128e77 | 6 | */ |
shintamainjp | 0:e9d9b1128e77 | 7 | #include "mbed.h" |
shintamainjp | 0:e9d9b1128e77 | 8 | #include "ChoroQ.h" |
shintamainjp | 0:e9d9b1128e77 | 9 | |
shintamainjp | 0:e9d9b1128e77 | 10 | ChoroQ cq(p21); |
shintamainjp | 0:e9d9b1128e77 | 11 | |
shintamainjp | 0:e9d9b1128e77 | 12 | /** |
shintamainjp | 0:e9d9b1128e77 | 13 | * Entry point. |
shintamainjp | 0:e9d9b1128e77 | 14 | */ |
shintamainjp | 0:e9d9b1128e77 | 15 | int main() { |
shintamainjp | 2:2acbc2d1a208 | 16 | ChoroQ::Channel ch = ChoroQ::ChA; |
shintamainjp | 2:2acbc2d1a208 | 17 | |
shintamainjp | 0:e9d9b1128e77 | 18 | while (1) { |
shintamainjp | 1:adcec9a96e89 | 19 | /* |
shintamainjp | 1:adcec9a96e89 | 20 | * get forward. |
shintamainjp | 1:adcec9a96e89 | 21 | */ |
shintamainjp | 0:e9d9b1128e77 | 22 | for (int i = 0; i < 10; i++) { |
shintamainjp | 2:2acbc2d1a208 | 23 | cq.execute(ch, ChoroQ::Up); |
shintamainjp | 0:e9d9b1128e77 | 24 | } |
shintamainjp | 0:e9d9b1128e77 | 25 | wait_ms(2000); |
shintamainjp | 0:e9d9b1128e77 | 26 | |
shintamainjp | 1:adcec9a96e89 | 27 | /* |
shintamainjp | 1:adcec9a96e89 | 28 | * go astern. |
shintamainjp | 1:adcec9a96e89 | 29 | */ |
shintamainjp | 0:e9d9b1128e77 | 30 | for (int i = 0; i < 10; i++) { |
shintamainjp | 2:2acbc2d1a208 | 31 | cq.execute(ch, ChoroQ::Down); |
shintamainjp | 0:e9d9b1128e77 | 32 | } |
shintamainjp | 0:e9d9b1128e77 | 33 | wait_ms(2000); |
shintamainjp | 0:e9d9b1128e77 | 34 | } |
shintamainjp | 0:e9d9b1128e77 | 35 | } |