2017_Bteam_beta_master_ashi
Dependencies: Alpha_Movements BoolProcess DataCaller_beta MD_PID mbed
Fork of 2017_Bteam_beta_master by
main.cpp@2:d836267af023, 2017-09-14 (annotated)
- Committer:
- hirotayamato
- Date:
- Thu Sep 14 00:30:04 2017 +0000
- Revision:
- 2:d836267af023
- Parent:
- 1:ebb68f50a49d
- Child:
- 4:ca415ec776be
2017_Bteam_beta_master_ashi
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Komazawa_sun | 0:847a475cf9a0 | 1 | #include "mbed.h" |
Komazawa_sun | 0:847a475cf9a0 | 2 | |
Komazawa_sun | 0:847a475cf9a0 | 3 | #include "DataPool.h" |
Komazawa_sun | 0:847a475cf9a0 | 4 | #include "AlphaTransporter.h" |
Komazawa_sun | 0:847a475cf9a0 | 5 | #include "BoolProcess.h" |
Komazawa_sun | 0:847a475cf9a0 | 6 | |
hirotayamato | 1:ebb68f50a49d | 7 | #include "2017_3_h.h" |
Komazawa_sun | 0:847a475cf9a0 | 8 | |
Komazawa_sun | 0:847a475cf9a0 | 9 | #define SDA PB_7 |
Komazawa_sun | 0:847a475cf9a0 | 10 | #define SCL PB_6 |
Komazawa_sun | 0:847a475cf9a0 | 11 | |
Komazawa_sun | 0:847a475cf9a0 | 12 | I2C *master; |
Komazawa_sun | 0:847a475cf9a0 | 13 | DataPool *beta; |
Komazawa_sun | 0:847a475cf9a0 | 14 | |
hirotayamato | 1:ebb68f50a49d | 15 | 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); |
Komazawa_sun | 0:847a475cf9a0 | 16 | Serial pc(USBTX, USBRX); |
Komazawa_sun | 0:847a475cf9a0 | 17 | |
Komazawa_sun | 0:847a475cf9a0 | 18 | int main() |
Komazawa_sun | 0:847a475cf9a0 | 19 | { |
Komazawa_sun | 0:847a475cf9a0 | 20 | master = new I2C(SDA, SCL); |
Komazawa_sun | 0:847a475cf9a0 | 21 | beta = new AlphaTransporter(master); |
hirotayamato | 1:ebb68f50a49d | 22 | |
hirotayamato | 1:ebb68f50a49d | 23 | Omni.Drive(0, 0, 0); |
hirotayamato | 1:ebb68f50a49d | 24 | float x, y, t; |
Komazawa_sun | 0:847a475cf9a0 | 25 | while(1) |
Komazawa_sun | 0:847a475cf9a0 | 26 | { |
hirotayamato | 1:ebb68f50a49d | 27 | beta->set(); |
hirotayamato | 1:ebb68f50a49d | 28 | |
hirotayamato | 2:d836267af023 | 29 | x = beta->read(0) / 128.00; |
hirotayamato | 2:d836267af023 | 30 | y = beta->read(1) / 128.00; |
hirotayamato | 2:d836267af023 | 31 | t = beta->read(2) / 128.00; |
hirotayamato | 1:ebb68f50a49d | 32 | Omni.Drive(x, y, t); |
hirotayamato | 2:d836267af023 | 33 | wait(0.1); |
Komazawa_sun | 0:847a475cf9a0 | 34 | } |
Komazawa_sun | 0:847a475cf9a0 | 35 | } |