春ロボ ロケット団 / Mbed 2 deprecated Right_F3RC_mar4_2

Dependencies:   mbed Encoder CruizCore_R1370P

Files at this revision

API Documentation at this revision

Comitter:
koheim
Date:
Mon Oct 07 13:59:50 2019 +0000
Parent:
2:8ab2c4ec07e7
Commit message:
aaa

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Oct 04 14:25:40 2019 +0000
+++ b/main.cpp	Mon Oct 07 13:59:50 2019 +0000
@@ -54,21 +54,21 @@
 //b is  value for going right or left
 //count is value for staying right potition of x-axis
 {
-    if((x - count)*(x - count) < 100) {
+    if((x - count)*(x - count) < 144) {//
         RF = 0;
         RB = a;
         LF = a;
         LB = 0;
         TF = 0;
         TB = 0;
-    } else if(x - count >= 10) {
+    } else if(x - count >= 12) {//
         RF = 0;
         RB = a + b/2;
         LF = a;
         LB = 0 + b/2;
         TF = 0 + b;
         TB = 0;
-    } else if (x - count <= -10) {
+    } else if (x - count <= -12) {//
         RF = 0 + b/2;
         RB = a;
         LF = a + b/2;
@@ -81,21 +81,21 @@
 void go_B(double a,int x,double b,int count)
 // b and count are same as go_S
 {
-    if((x - count)*(x - count) < 100) {
+    if((x - count)*(x - count) < 144) {//
         RF = a;
         RB = 0;
         LF = 0;
         LB = a;
         TF = 0;
         TB = 0;
-    } else if(x - count >= 10) {
+    } else if(x - count >= 12) {//
         RF = a;
         RB = 0 + b/2;
         LF = 0;
         LB = a + b/2;
         TF = 0 + b;
         TB = 0;
-    } else if (x - count <= -10) {
+    } else if (x - count <= -12) {//
         RF = a + b/2;
         RB = 0;
         LF = 0 + b/2;
@@ -111,7 +111,7 @@
     TF = 0;
     RF = a/2;
     RB = 0;
-    LF = a/2;
+    LF = a/4;//
     LB = 0;
 }
 
@@ -174,7 +174,7 @@
         pc.printf("   y=%d   ",count2);
         pc.printf(" angle=%8.4f ",angle);
         pc.printf("\r\n");
-        go_S(0.4,200,0.1,count);
+        go_S(/*0.4*/0.5,200,0.1,count);//
         rotation(angle);
     }
     go_L(0);
@@ -186,7 +186,7 @@
         pc.printf("   y=%d   ",count2);
         pc.printf(" angle=%8.4f ",angle);
         pc.printf("\r\n");
-        go_S(0.2,200,0.1,count);
+        go_S(/*0.2*/0.3,200,0.1,count);//
         rotation(angle);
     }
     go_L(0);
@@ -250,7 +250,7 @@
         pc.printf("   y=%d   ",count2);
         pc.printf(" angle=%8.4f ",angle);
         pc.printf("\r\n");
-        go_B(0.4,200,0.1,count);
+        go_B(/*0.4*/0.5,200,0.1,count);//
         rotation(angle);
     }
     go_L(0);
@@ -358,7 +358,8 @@
     }
     go_L(0);
     pc.printf("5\r\n");
-    int old_count,old_count2;
+    int old_count;
+    int old_count2;
     old_count=EC.getCount();
     old_count2=EC2.getCount();
     while(count2 < 11800) {