Yuya Aihara / Mbed 2 deprecated maimai

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
aihara
Date:
Sat Dec 19 09:57:10 2020 +0000
Parent:
1:fb92cf1c694b
Commit message:
a;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat Dec 19 08:19:25 2020 +0000
+++ b/main.cpp	Sat Dec 19 09:57:10 2020 +0000
@@ -18,25 +18,29 @@
     double distance;
     
     pc.printf("GPS begin\n");
-    
-    while(1){
-        GPS gps (D1,D0); 
+  wait(2);
+    GPS gps (D1,D0); 
+    while(1){ 
         if(gps.getgps()){
             /*a,bを緯度経度の初期値で初期化*/
             a = gps.latitude;
             b = gps.longitude;
-            Serial xbee(D1,D0);
+            wait(2);
+            Serial xbee(D1,D0);//Xbeeのピン
             pc.printf("get1");          
             break;
         }else{
-            Serial xbee(D1,D0);
+            wait(2);
+            Serial xbee(D1,D0);//Xbeeのピン
             pc.printf("Fault_No_Data1\r\n");
             wait(1);
         }
-    }  
-    while(1){
-         GPS gps (D1,D0); 
+    } 
+    //wait(2); 
+    //GPS gps (D1,D0);
+    while(1){ 
          if(gps.getgps()){
+            wait(2);
             Serial xbee(D1,D0);//Xbeeのピン
             printf("get2");
              
@@ -74,6 +78,7 @@
             }//データ取得失敗を表示、通信、1秒待機
                
             }
+            
     pc.printf("成功\n");
     return 0;
 }
\ No newline at end of file