Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: RemoteIR TextLCD
Diff: main.cpp
- Revision:
- 46:c6deb699160b
- Parent:
- 45:76e8c07d76ef
- Child:
- 47:8a5a4275480a
diff -r 76e8c07d76ef -r c6deb699160b main.cpp
--- 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);