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:
- 12:2f0c841e6078
- Parent:
- 11:80284e989390
- Child:
- 13:b884f5960fbf
- Child:
- 14:d2f0aef62909
diff -r 80284e989390 -r 2f0c841e6078 main.cpp
--- a/main.cpp Mon Nov 05 12:50:18 2018 +0000
+++ b/main.cpp Thu Nov 08 09:51:48 2018 +0000
@@ -51,7 +51,7 @@
motor1.stop(0);
motor2.stop(0);
- printf("GPS start\r\n");
+ /* printf("GPS start\r\n");
FILE *fp = fopen("/local/gps.txt", "w"); // Open "gps.txt" on the local file system for writing
fprintf(fp, "GPS Start\r\n");
int n;
@@ -70,7 +70,7 @@
}
fprintf(fp,"GPS finish\r\n");
- fclose(fp); //GPSの測定終了
+ fclose(fp); //GPSの測定終了 */
@@ -195,8 +195,8 @@
ms1=1.0; //直進の時モーターをどれだけ回せばいいかわからないのでとりあえず1.0にしておく⇒waitの秒数を変えた方が良い感じ
ms2=1.0;
- msj1=0.234; //回転の時
- msj2=0.234;
+ msj1=1.0; //回転の時
+ msj2=1.0;
motor1.stop(0);
motor2.stop(0);
@@ -205,7 +205,7 @@
motor1.speed(msj1); //機体を時計回りに90度回転
motor2.speed(-msj2);
- wait(2);
+ wait(0.77);
printf("mortor rotation\r\n");
motor1.stop(0);
@@ -225,7 +225,7 @@
motor1.speed(-msj1); //機体を反時計回りに90度回転
motor2.speed(msj2);
- wait(2);
+ wait(0.77);
printf("mortor rotation\r\n");
motor1.stop(0);
@@ -235,8 +235,11 @@
motor1.speed(ms1); //直進
motor2.speed(ms2);
-
- /* printf("%d\r\n", test.read()); ここの部分は単純に5mを足すことにした方がいいかな?
+ int t=0;
+ for(t=0;t<10;t++)
+ {
+ printf("%d\r\n", test.read());
+ printf("%d\r\n", test2.read());
if (test.read() == 1 and flag == 0)
{
flag = 1;
@@ -254,8 +257,8 @@
leftrun2 += 52.5;
}
printf("%f", rightrun);
- printf("\t%f\r\n", leftrun2);*/
- wait(2);
+ printf("\t%f\r\n", leftrun2);
+ }
printf("mortor straight\r\n");
motor1.stop(0);
@@ -265,7 +268,7 @@
motor1.speed(-msj1); //機体を反時計回りに90度回転
motor2.speed(msj2);
- wait(2);
+ wait(0.77);
printf("mortor rotation\r\n");
motor1.stop(0);
@@ -285,7 +288,7 @@
motor1.speed(msj1); //機体を時計回りに90度回転
motor2.speed(-msj2);
- wait(2);
+ wait(0.77);
printf("mortor rotation\r\n");
motor1.stop(0);
@@ -296,7 +299,6 @@
}
}
-
motor1.stop(0);
motor2.stop(0);