
赤子を殺すより楽な作業よ
Dependencies: RemoteIR TextLCD
Revision 7:4a65f5a25c13, committed 2020-07-29
- Comitter:
- tomotsugu
- Date:
- Wed Jul 29 08:12:46 2020 +0000
- Parent:
- 6:4817fe7b7654
- Commit message:
- robot_car
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Jul 29 07:57:16 2020 +0000 +++ b/main.cpp Wed Jul 29 08:12:46 2020 +0000 @@ -180,7 +180,7 @@ viewTimer.reset(); display(); } - ThisThread::sleep_for(90); + ThisThread::sleep_for(90); // 90ms待つ } } @@ -219,14 +219,17 @@ motorL2 = LOW; break; } - ThisThread::sleep_for(30); + if(flag_sp > VERYFAST){ + flag_sp -= 3 * (flag_sp / 3); + } + ThisThread::sleep_for(30); // 30ms待つ } } /* スピード変更関数 */ void changeSpeed(){ - if(flag_sp == VERYFAST){ // 最速の場合 - flag_sp = NORMAL; // 普通に設定 + if(flag_sp%3 == 2){ // 最速の場合 + flag_sp -= 2; // 2段階下げる } else{ // 最速以外の場合 flag_sp = flag_sp + 1; // 1段階上げる