大季 矢花 / Mbed 2 deprecated MB2019_main_11_17_lhazime

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
yabahiro
Date:
Sun Nov 17 02:51:05 2019 +0000
Parent:
53:694dbd7dfa0e
Commit message:
aa;

Changed in this revision

System/Process/Process.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/System/Process/Process.cpp	Fri Nov 15 11:49:03 2019 +0000
+++ b/System/Process/Process.cpp	Sun Nov 17 02:51:05 2019 +0000
@@ -824,6 +824,7 @@
                 if(g[3]==98&&countss>=10000) {
                     mode=22;
                     countss=0;
+                    cross=0;
                     fast=60;
                     normal=40;
                     slow=20;
@@ -839,9 +840,10 @@
                 motor[TIRE_BL].dir = BRAKE;
                 if(g[0]==0) {
                     mode=22;
-                    fast=60;
-                    normal=40;
-                    slow=25;
+                    cross=0;
+                    fast=80;
+                    normal=60;
+                    slow=40;
                 }
             }
             break;
@@ -959,23 +961,20 @@
                     countss=0;
                 }
             } else {
-                if(g[0]==98) {
+                if(cross==2) {
                     slow=25;
                     normal=30;
                     fast=30;
-                }
-                if(g[3]==0) {
-                    slow=25;
-                    normal=40;
-                    fast=60;
-                    mode=23;
+                    if(g[3]==0) {
+                        solenoid.solenoid2 = SOLENOID_OFF;
+                        slow=40;
+                        normal=60;
+                        fast=80;
+                        mode=23;
+                    }
                 }
                 switch(g[0]) {
                     case 98:
-                        solenoid.solenoid2 = SOLENOID_OFF;
-                        fast=40;
-                        normal=30;
-                        slow=25;
                         motor[TIRE_FR].pwm = normal;
                         motor[TIRE_FR].dir = BACK;
                         motor[TIRE_FL].pwm = normal+5;
@@ -984,6 +983,10 @@
                         motor[TIRE_BR].dir = BACK;
                         motor[TIRE_BL].pwm = normal;
                         motor[TIRE_BL].dir = FOR;
+                        if(countss>30000) {
+                            cross++;
+                            countss=0;
+                        }
                         break;
                     case 0:
                         motor[TIRE_FR].pwm = fast;
@@ -1756,11 +1759,9 @@
             }
             break;
         case 41:
-            /*
-                if(LIF||LIB) {
-                    mode=42;
-                }
-                */
+            if(LIF||LIB) {
+                mode=42;
+            }
             motor[TIRE_FR].pwm = 30;
             motor[TIRE_FR].dir = BACK;
             motor[TIRE_FL].pwm = 0;