another

Dependencies:   mbed KondoServoLibrary Encoder

Files at this revision

API Documentation at this revision

Comitter:
o2132613
Date:
Sat Mar 21 04:02:09 2020 +0000
Parent:
26:3adbabf7d770
Commit message:
test;

Changed in this revision

User.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/User.cpp	Sat Mar 21 03:15:26 2020 +0000
+++ b/User.cpp	Sat Mar 21 04:02:09 2020 +0000
@@ -55,7 +55,7 @@
 void catch_ball();
 void catch_box();
 void show_angle();
-
+int shot_but;
 int X_count=0;
 void Xcount()
 {
@@ -147,10 +147,12 @@
     //shoot
     if((ButtonState >> BUTTONCIRCLE)&1 == 1 && (ButtonState >> BUTTONLEFT)&1 == 1 ) {//O & left shot reset
         shoot =0;
+        shot_but = 1;
         printf("shoot 0\r\n");
         led2 = 1;
     } else if((ButtonState >> BUTTONCIRCLE)&1 == 1) {//O
         shoot = shoot +1;
+        shot_but = 1;
         if(shoot > 3) {
             shoot =0;
         }
@@ -176,7 +178,7 @@
     }
 
     //CAN通信用プログラム
-    ballShot(shoot);
+    if(shot_but!=0)ballShot(shoot);
     catch_ball();
     catch_box();
     can[0] = move;
@@ -199,7 +201,7 @@
                 printf("%d\r\n",touchSensor.read());
                 printf("%d\r\n",EC.getCount());
                 f=0;
-                b=0.09;
+                b=0.07;
                 if(touchSensor==0) {//受け渡し
                     f=0;
                     b=0;
@@ -207,6 +209,7 @@
                     EC.reset();
                     printf("%d",EC.getCount());
                     breaknum=1;
+                    shot_but = 0;
                 }
             }
             break;
@@ -230,6 +233,7 @@
                 EC.reset();
                 break;
             }
+            shot_but= 0;
             break;
         case 3:
             X_count=0;
@@ -270,6 +274,7 @@
             led4=0;
             shoot=0;
             breaknum=0;
+            shot_but=0;
             break;
     }
 }