gps

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
naruu
Date:
Thu Oct 15 08:22:47 2020 +0000
Parent:
2:04767523b307
Commit message:
s

Changed in this revision

getGPS.h Show annotated file Show diff for this revision Revisions of this file
gps.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/getGPS.h	Wed Oct 07 08:05:22 2020 +0000
+++ b/getGPS.h	Thu Oct 15 08:22:47 2020 +0000
@@ -16,5 +16,4 @@
     Serial _gps;
 };
  
-#endif 
-            
\ No newline at end of file
+#endif
\ No newline at end of file
--- a/gps.cpp	Wed Oct 07 08:05:22 2020 +0000
+++ b/gps.cpp	Thu Oct 15 08:22:47 2020 +0000
@@ -3,7 +3,7 @@
 #include"math.h"
 
 Serial pc(USBTX,USBRX);
-GPS gps(D12,D13);
+GPS gps(D0,D1);
 Serial xbee(D0,D1);
 
 int main(){
@@ -18,7 +18,8 @@
             /*a,bを緯度経度の初期値で初期化*/
             a=gps.latitude;
             b=gps.longitude;
-            pc.printf("(%lf,%lf)\r\n",gps.latitude,gps.longitude);//緯度と経度を表示
+            printf("------------\r\n");
+            pc.printf("(北緯:%lf,東経%lf)\r\n",gps.latitude,gps.longitude);//緯度と経度を表示
                       break;
         }else{
             pc.printf("Fault_No_Data\r\n");
@@ -26,7 +27,8 @@
         }
          } while(1){
          if(gps.getgps()){
-             pc.printf("(%lf,%lf)\n\r",gps.latitude,gps.longitude);//緯度と経度を表示
+             printf("------------\r\n");
+             pc.printf("(北緯%lf,東経%lf)\n\r",gps.latitude,gps.longitude);//緯度と経度を表示
              
     /*ここから距離の計算*/
                  /*c、dを得た緯度経度の値で初期化*/   
@@ -59,7 +61,7 @@
 
             }else {
                // xbee.print("False_No_Data\r\n");
-                pc.printf("False_No_Date\r\n");
+                pc.printf("False_No_Data\r\n");
                 wait(1);
             }//データ取得失敗を表示、通信、1秒待機
         }