cansat_B 2019 / Mbed 2 deprecated CanSatB2019_main_1212_2

Dependencies:   mbed

Revision:
10:b190babac114
Parent:
9:ec770f68440e
Child:
11:abe08fabf344
--- a/main.cpp	Sun Dec 08 13:38:35 2019 +0000
+++ b/main.cpp	Mon Dec 09 10:43:47 2019 +0000
@@ -58,12 +58,13 @@
      int k = 0;
      int j = 0;
      
-    pc.printf("GPS Start\r\n");
-    xbee.printf("s\n");
-      if(gps.getgps()){
+     pc.printf("GPS Start\n");
+     xbee.printf("s\n");
+     while(1) {
+         if(gps.getgps()){
            
           pc.printf("(%lf,%lf)\r\n",gps.latitude,gps.longitude);//緯度と経度を表示   
-          i ++;
+          k ++;
           if(k<59){
            }else{
            a = gps.latitude;
@@ -77,13 +78,13 @@
             }
        }
        printf("moter on");
-        left = 100; //左モーター100%
-        right = 100;//右モーター100%
+        left1 = 100; //左モーター100%
+        right1 = 100;//右モーター100%
         
         wait(30);
         printf("moter off");
-        left = 0; //左モーター10%
-        right = 0;//右モーター10%(左折)
+        left1 = 0; //左モーター0%
+        right1 = 0;//右モーター0%
         printf("moter off");
         wait(15);
         printf("GPS restart\n");
@@ -126,8 +127,8 @@
             }
        }else{
          printf("No data");
-         }
-       } //GPS End     
+          }
+        } //GPS End     
 
  int i=1;
   float th;