Bteam tactics plan A _ move table ver

Dependencies:   HCSR04 PID QEI mbed

Fork of UNKO_FINAL by NITICRobotClub 2018Team-B

Revision:
13:93321c73df60
Parent:
12:1a22b9797004
Child:
14:677e9f0785b8
diff -r 1a22b9797004 -r 93321c73df60 main.cpp
--- a/main.cpp	Wed Oct 10 12:33:40 2018 +0000
+++ b/main.cpp	Wed Oct 10 16:58:39 2018 +0000
@@ -81,7 +81,7 @@
 #define high_table 5
 
 //2段低最小距離
-#define low_grade_minimum_distance 7
+#define low_grade_minimum_distance 4
 //2段低最大距離
 #define low_grade_maximum_distance 16
 
@@ -1465,9 +1465,8 @@
             myled4 = 0;
         }
 
-        /*
         //6発発射したら弾倉切り替え
-        if(mouted_bottles == 6) {
+        if(mouted_bottles == 10) {
             if(photo_interrupter == 0) {
                 loading_data[0] = 0x0C;
                 i2c.write(0x30, loading_data, 1, false);
@@ -1476,7 +1475,6 @@
                 i2c.write(0x30, loading_data, 1, false);
             }
         }
-        */
 
         //pc.printf("%3d %3d %3d %3d %3d %3d\n\r", front_line_state, back_line_state, line_state_pettern, abs(measure_pulse), distance, mouted_bottles);
         //pc.printf("%d %3lf\n\r", mouted_bottles, timer.read());
@@ -1516,8 +1514,8 @@
                         //発射距離に到達して1秒待って発射
                         if(timer.read() > 1.0f && timer.read() <= 2.5f) {
                             cylinder_data[0] = 5;
+                            mouted_bottles = 5;
                             i2c.write(0x40, cylinder_data, 1);
-                            mouted_bottles++;
                         }
                         else if(timer.read() > 12.5f && timer.read() <= 15.0f) {
                             cylinder_data[0] = 0x80;
@@ -1529,8 +1527,8 @@
                         else if(timer.read() > 15.5f && timer.read() <= 17.5f) {
                             line_state_pettern = stop;
                             cylinder_data[0] = 5;
+                            mouted_bottles = 10;
                             i2c.write(0x40, cylinder_data, 1);
-                            mouted_bottles++;
                         }
                         else if(timer.read() > 28.0f && timer.read() <= 30.0f) {
                             line_state_pettern = stop;
@@ -1543,8 +1541,8 @@
                         else if(timer.read() > 31.0f && timer.read() <= 33.0f) {
                             line_state_pettern = stop;
                             cylinder_data[0] = 5;
+                            mouted_bottles = 15;
                             i2c.write(0x40, cylinder_data, 1);
-                            mouted_bottles++;
                         }
                         else if(timer.read() > 33.0f && timer.read() <= 43.0f) {
                             line_state_pettern = stop;