GPS精度実験
Fork of MBed_Adafruit-GPS-Library by
Diff: MBed_Adafruit_GPS.cpp
- Revision:
- 1:ff72e93bcb0e
- Parent:
- 0:a23e3099bb0a
- Child:
- 2:8203e954d8e1
diff -r a23e3099bb0a -r ff72e93bcb0e MBed_Adafruit_GPS.cpp --- a/MBed_Adafruit_GPS.cpp Sat Mar 22 05:00:47 2014 +0000 +++ b/MBed_Adafruit_GPS.cpp Tue May 20 14:51:14 2014 +0000 @@ -61,7 +61,9 @@ // parse out latitude p = strchr(p, ',')+1; - latitude = atof(p); + latitudeH = atol(p); + p = strchr(p, '.')+1; + latitudeL = atol(p); p = strchr(p, ',')+1; if (p[0] == 'N') lat = 'N'; @@ -71,7 +73,9 @@ // parse out longitude p = strchr(p, ',')+1; - longitude = atof(p); + longitudeH = atol(p); + p = strchr(p, '.')+1; + longitudeL = atol(p); p = strchr(p, ',')+1; if (p[0] == 'W') lon = 'W'; @@ -120,7 +124,9 @@ // parse out latitude p = strchr(p, ',')+1; - latitude = atof(p); + latitudeH = atol(p); + p = strchr(p, '.')+1; + latitudeL = atol(p); p = strchr(p, ',')+1; if (p[0] == 'N') lat = 'N'; @@ -130,8 +136,10 @@ // parse out longitude p = strchr(p, ',')+1; - longitude = atof(p); - + longitudeH = atol(p); + p = strchr(p, '.')+1; + longitudeL = atol(p); + p = strchr(p, ',')+1; if (p[0] == 'W') lon = 'W'; else if (p[0] == 'E') lon = 'E'; @@ -215,8 +223,9 @@ lat = lon = mag = 0; // char fix = false; // bool milliseconds = 0; // uint16_t - latitude = longitude = geoidheight = altitude = - speed = angle = magvariation = HDOP = 0.0; // float + geoidheight = altitude = speed = angle = magvariation = HDOP = 0.0; // float + latitudeH = latitudeL = longitudeH = longitudeL = 0; + } void Adafruit_GPS::begin(int baud)