gps

Dependencies:   mbed

Revision:
3:c64909f39383
Parent:
1:6165e8067d7a
--- 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秒待機
         }