otamesi
Dependencies: mbed
Diff: main.cpp
- Revision:
- 22:1e01f4f7097c
- Parent:
- 20:e78bffff80ee
- Child:
- 24:a09b08663a7c
--- a/main.cpp Sat Dec 01 03:23:36 2018 +0000 +++ b/main.cpp Thu Dec 06 10:23:58 2018 +0000 @@ -125,14 +125,14 @@ mcn2=1.0; compass.init(); heading=compass.getHeadingXYDeg(); -if(2.5<heading<=M_PI){ +if(92.5<heading<=270.0){ motor1.speed(mcn1); motor2.speed(-mcn2); wait(heading*0.01); //角度のずれ*1度回転するのにかかる時間 motor1.stop(0); motor2.stop(0); wait(1); -}else if(M_PI<heading<357.5){ +}else if(270.0<heading<PI2 && 0<=heading<87.5){ motor1.speed(-mcn1); motor2.speed(mcn2); wait((PI2-heading)*0.01);