ボタンを押すと、 バッテリ更新を停止し、 他のボタンもロックさせる
Dependencies: RemoteIR TextLCD
Diff: main.cpp
- Revision:
- 29:600e4b9b5c5b
- Parent:
- 28:cb51cafca490
- Child:
- 30:c80da0ecc260
diff -r cb51cafca490 -r 600e4b9b5c5b main.cpp --- a/main.cpp Thu Aug 06 03:02:32 2020 +0000 +++ b/main.cpp Thu Aug 06 03:05:34 2020 +0000 @@ -94,19 +94,17 @@ int far; // 最も遠い距離 int houkou; // 進行方向(1:前 2:左 3:右) int i; // ループ変数 -int t1,t2=0; +int t1 = 0; /*WiFi用変数*/ Timer time1; Timer time2; int bufflen, DataRX, ount, getcount, replycount, servreq, timeout; int bufl, ipdLen, linkID, weberror, webcounter,click_flag; -//float temperature, AdcIn, Ht; float R1=100000, R2=10000; // resistor values to give a 10:1 reduction of measured AnalogIn voltage char Vcc[10]; char webcount[8]; char type[16]; -char type1[16]; char channel[2]; char cmdbuff[32]; char replybuff[1024]; @@ -449,8 +447,7 @@ trig = 0; timer.start(); t1=timer.read_ms(); - t2=timer.read_ms(); - while(echo.read() == 0 &&(t1-t2)<10){ + while(echo.read() == 0 && t1<10){ t1=timer.read_ms(); led1 = 1; } @@ -458,7 +455,7 @@ timer.reset(); /*if((t1-t2) >= 10){ run = STOP;*/ - }while((t1-t2) >= 10); + }while(t1 >= 10); timer.start(); // 距離計測タイマースタート while(echo.read() == 1){ }