2017_Bteam_alpha_master_ashi
Dependencies: Alpha_Movements BoolProcess DataCaller MD_PID mbed angle
Fork of 2017_Bteam_alpha_master by
Diff: main.cpp
- Revision:
- 1:12e4c91a3b04
- Parent:
- 0:7318c0dde997
- Child:
- 3:8d143b23df2a
diff -r 7318c0dde997 -r 12e4c91a3b04 main.cpp --- a/main.cpp Fri Sep 08 03:58:36 2017 +0000 +++ b/main.cpp Fri Sep 08 06:26:22 2017 +0000 @@ -6,6 +6,7 @@ #include "ArrowShooter.h" +#include "2017_4.h" #define SDA PB_7 #define SCL PB_6 @@ -13,6 +14,7 @@ I2C *master; DataPool *alpha; +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); Serial pc(USBTX, USBRX); double fire_work_time; @@ -23,6 +25,9 @@ master = new I2C(SDA, SCL); alpha = new AlphaTransporter(master); ArrowShooter shooter(master); + + Mekanamu.Drive(0, 0, 0); + float x, y, t; while(1) { alpha->set(); @@ -38,6 +43,11 @@ } if(fire_work_time >= 3.7) fire_work_allow = 0; + + x = alpha->read(0) / 128; + y = alpha->read(1) / 128; + t = alpha->read(2) / 128; + Mekanamu.Drive(x, y, t); //printf("%f\r\n", fire_work_time); }