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: mbed
Diff: main.cpp
- Revision:
- 22:1e01f4f7097c
- Parent:
- 20:e78bffff80ee
- Child:
- 24:a09b08663a7c
diff -r 5fa04278ec78 -r 1e01f4f7097c main.cpp
--- 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);