2017_Bteam_beta_master_ashi
Dependencies: Alpha_Movements BoolProcess DataCaller_beta MD_PID mbed
Fork of 2017_Bteam_beta_master by
main.cpp@12:dbff655e398e, 2017-09-27 (annotated)
- Committer:
- hirotayamato
- Date:
- Wed Sep 27 06:52:21 2017 +0000
- Revision:
- 12:dbff655e398e
- Parent:
- 11:adb0e189fe90
- Child:
- 14:b2569bdcd716
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 | 9:6b06d46ef5c2 | 15 | Omni_3 Omni(PB_4, PB_0, PA_7, PA_12, PB_5, PB_1, PA_5, PA_6, PA_11, PF_0, PA_3, PA_4, 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 | 12:dbff655e398e | 23 | Omni.Drive(0, 0, 0, 0); |
hirotayamato | 12:dbff655e398e | 24 | float a, 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 | 5:da391f9d2152 | 29 | x = beta->read(0) / 128.00 * -1.00; |
hirotayamato | 5:da391f9d2152 | 30 | y = beta->read(1) / 128.00 * -1.00; |
hirotayamato | 5:da391f9d2152 | 31 | t = beta->read(2) / 128.00 * -1.00; |
hirotayamato | 10:68987291c3b4 | 32 | |
hirotayamato | 12:dbff655e398e | 33 | Omni.Drive(a, x, y, t); |
hirotayamato | 12:dbff655e398e | 34 | |
hirotayamato | 10:68987291c3b4 | 35 | wait(0.01); |
Komazawa_sun | 0:847a475cf9a0 | 36 | } |
Komazawa_sun | 0:847a475cf9a0 | 37 | } |