linetrace saikyou
Dependencies: RemoteIR TextLCD
Diff: main.cpp
- Revision:
- 54:f862caf08a7f
- Parent:
- 53:debc8879ba5d
- Child:
- 55:d3c19efa1ef9
--- a/main.cpp Wed Sep 02 07:18:04 2020 +0000 +++ b/main.cpp Wed Sep 02 07:20:41 2020 +0000 @@ -391,6 +391,20 @@ motorL1 = LOW; motorL2 = 0.33; break; + /* 低速右折 */ + case LT_R: + motorR1 = motorSpeedR2[flag_sp]; // 右前進モーターON + motorR2 = LOW; // 右後退モーターOFF + motorL1 = motorSpeedL1[flag_sp]; // 左前進モーターON + motorL2 = LOW; // 左後退モーターOFF + break; + /* 低速左折 */ + case LT_L: + motorR1 = motorSpeedR1[flag_sp]; // 右前進モーターON + motorR2 = LOW; // 右後退モーターOFF + motorL1 = motorSpeedL2[flag_sp]; // 左前進モーターON + motorL2 = LOW; // 左後退モーターOFF + break; } /*if(flag_sp > VERYFAST){ // スピード変更フラグが2より大きいなら flag_sp %= 3; // スピード変更フラグ調整 @@ -793,7 +807,7 @@ void bChange(){ //pc.printf(" bChange1\r\n"); if(run == STOP){ - b = (int)((((battery.read() * 3.3 - MIN_V)/0.67)*10+0.5)*10); + b = (int)(((battery.read() * 3.3 - MIN_V)/0.67)*10+0.5)*10; } if(b <= 0){ // バッテリー残量0%なら全ての機能停止 b = 0;