Mbed library to get location informatiuon from GYSFDMAXB

Dependents:   Izu_2019

Revision:
5:6231c440275d
Parent:
1:68601d2af8a5
--- a/GPS.cpp	Sun Jul 30 13:52:03 2017 +0000
+++ b/GPS.cpp	Sat Mar 02 15:15:29 2019 +0000
@@ -4,7 +4,7 @@
 GPS::GPS(PinName gpstx,PinName gpsrx): _gps(gpstx,gpsrx)
 {
     latitude=0;
-    longtitude=0;
+    longitude=0;
     
     gpscmd("314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0");
     int odr=ODR;
@@ -26,7 +26,11 @@
     
     _gps.baud(GPSBAUD);
     
-    _gps.attach(this,&GPS::getgps);
+    //_gps.attach(this,&GPS::getgps);
+}
+
+GPS::~GPS()
+{
 }
 
 void GPS::gpscmd(char *command)
@@ -75,7 +79,7 @@
             
         //初期化
         latitude=0;
-        longtitude=0;
+        longitude=0;
         
             //データ取得
             for(counter=0;sample!='\n';counter++){
@@ -128,7 +132,7 @@
                         num=num*10;
                     }
                     
-                    longtitude+=(float)num*(buf[counter]-48);
+                    longitude+=(float)num*(buf[counter]-48);
                 }
                 
             minute=0;
@@ -146,7 +150,7 @@
                     minute+=(float)num*(buf[counter]-48);
                 }
             
-            longtitude+=minute/60;
+            longitude+=minute/60;
             
             
                 result=true;