zahyou kime hukume

Dependencies:   mbed getGPS

Revision:
5:d78746981e4f
Parent:
4:962ecf61540b
Child:
6:4eb0f2c63da0
--- a/main.cpp	Wed Dec 01 08:44:56 2021 +0000
+++ b/main.cpp	Thu Dec 02 05:50:51 2021 +0000
@@ -63,7 +63,7 @@
     while(gps.getgps() != true){
         xbee.printf("false\r\n");
     }
-
+    gps.getgps();
     m=gps.latitude;
     n=gps.longitude;
     xbee.printf("m:%f,n:%f\r\n", m, n);
@@ -88,7 +88,7 @@
         c = (e-f)/(1+e*f);
         xbee.printf("c:%f\r\n",c);
 //t[0]は回る時間、t[1]はかかる時間、rに何回進むプログラムを動かすかを決める        
-        double t[2] = {w/3.14159/0.9,2*j/3/1.2}; //再度図るのは、全体の2/3だけ進んだとき
+        double t[2] = {w/3.14159/0.9,2*j/3/1.0}; //再度図るのは、全体の2/3だけ進んだとき
         r = t[1]/2.2;
         wait(1);
         xbee.printf("c*i:%f\r\n", c*i);
@@ -161,6 +161,7 @@
         while(gps.getgps() != true){
 //            xbee.printf("false\r\n");
         }
+        gps.getgps();
         x = gps.latitude;
         y = gps.longitude;
 //5秒前進する
@@ -172,7 +173,7 @@
         wait(2);
         driveMotor(0,0);
 //m,nに現在の経度、緯度を記録する
-
+        gps.getgps();
         m=gps.latitude;
         n=gps.longitude;
         a[0]=m-x;