ボタンを押すと、 バッテリ更新を停止し、 他のボタンもロックさせる

Dependencies:   RemoteIR TextLCD

Revision:
46:c6deb699160b
Parent:
45:76e8c07d76ef
Child:
47:8a5a4275480a
--- a/main.cpp	Thu Aug 20 02:57:46 2020 +0000
+++ b/main.cpp	Mon Aug 24 01:57:48 2020 +0000
@@ -93,7 +93,6 @@
 const int limit = 20;   // 障害物の距離のリミット(単位:cm)
 int far;                // 最も遠い距離
 int houkou;             // 進行方向(1:前 2:左 3:右)
-int i;                  // ループ変数
 int t1 = 0;
 
 /*WiFi用変数*/
@@ -291,7 +290,7 @@
                 break;
         }
         if(flag_sp > VERYFAST){             // スピード変更フラグが2より大きいなら
-            flag_sp -= 3 * (flag_sp / 3);   // スピード変更フラグ調整
+            flag_sp %= 3   // スピード変更フラグ調整
         }
         ThisThread::sleep_for(30);          // 30ms待つ
     }
@@ -364,6 +363,7 @@
 
 /* 障害物回避走行スレッド */
 void avoidance(){
+    int i;
     while(1){  
         watchsurrounding3();
         pc.printf("%d  %d  %d  %d  %d  \r\n",SL,SLD,SC,SRD,SR);