cansat_B 2019 / Mbed 2 deprecated CanSatB2019_main_1214_essence_8_6

Dependencies:   mbed

Revision:
12:eb4befc8d2c4
Parent:
11:6f553aa95d08
Child:
13:63746a793db9
--- a/main.cpp	Sat Dec 14 02:44:17 2019 +0000
+++ b/main.cpp	Sat Dec 14 10:01:17 2019 +0000
@@ -44,7 +44,7 @@
     printf("CanSat-B_Start!\r\n");
 
      //FET
-     while(1){
+     /*while(1){
      if(flight==1) {
         wait(10);
         printf("mada\r\n");
@@ -66,7 +66,7 @@
     break;
             }
     }   
-    }
+    }*/
     
     
       //以下GPS
@@ -77,18 +77,25 @@
      int j = 0;
      
      pc.printf("GPS Start\n");
-     xbee.printf("s\n");
+     xbee.printf("s\n");//printf("1");
      while(1){
-         if(gps.getgps()){
+         /*printf("2");*/int received_data = xbee.getc();
+         if(gps.getgps()||received_data == 97){
            
           pc.printf("(%lf,%lf)\r\n",gps.latitude,gps.longitude);//緯度と経度を表示   
-          k ++;
-          if(k<59){
-           }else{
+          k++;
            a = gps.latitude;
            b = gps.longitude;
-           printf("(a =%lf,b =%lf)\r\n",gps.latitude,gps.longitude);//a,bを表示   
-           break;
+          if(k<10){
+           printf("%d",k); if(a!=0)
+                         xbee.printf("dont worry! GPSは動いてるよ!\n");
+           }else{
+                 /* a = gps.latitude;
+                  b = gps.longitude;*/
+                 /* if(a!=0)
+                         xbee.printf("dont worry! GPSは動いてるよ!\n");*/
+                  printf("(a =%lf,b =%lf)\r\n",gps.latitude,gps.longitude);//a,bを表示  
+                  break;
            }
          }else{
           pc.printf("NO DATA\r\n");//データ取得失敗
@@ -99,7 +106,7 @@
         left1 = 100; //左モーター100%
         right1 = 100;//右モーター100%
         
-        wait(30);
+        wait(10);
         printf("moter off");
         left1 = 0; //左モーター0%
         right1 = 0;//右モーター0%