Skip to content

Commit

Permalink
Remove scaling from minute calulcation.
Browse files Browse the repository at this point in the history
Pull #13 added scaling of minute values by 50 / 3, but this seems to cause problems like minute values going over 60.  Removing this calculation to take the exact minute value given by the module.
  • Loading branch information
tdicola committed Aug 8, 2014
1 parent ffb1979 commit 7ca1d78
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Adafruit_GPS.cpp
Expand Up @@ -72,7 +72,7 @@ boolean Adafruit_GPS::parse(char *nmea) {
p += 3; // skip decimal point
strncpy(degreebuff + 2, p, 4);
degreebuff[6] = '\0';
long minutes = 50 * atol(degreebuff) / 3;
long minutes = atol(degreebuff) * 10;
latitude_fixed = degree + minutes;
latitude = latitude_fixed / 100000.0F;

Expand All @@ -92,7 +92,7 @@ boolean Adafruit_GPS::parse(char *nmea) {
p += 3; // skip decimal point
strncpy(degreebuff + 2, p, 4);
degreebuff[6] = '\0';
minutes = 50 * atol(degreebuff) / 3;
minutes = atol(degreebuff) * 10;
longitude_fixed = degree + minutes;
longitude = longitude_fixed / 100000.0F;

Expand Down Expand Up @@ -151,7 +151,7 @@ boolean Adafruit_GPS::parse(char *nmea) {
p += 3; // skip decimal point
strncpy(degreebuff + 2, p, 4);
degreebuff[6] = '\0';
long minutes = 50 * atol(degreebuff) / 3;
long minutes = atol(degreebuff) * 10;
latitude_fixed = degree + minutes;
latitude = latitude_fixed / 100000.0F;

Expand All @@ -171,7 +171,7 @@ boolean Adafruit_GPS::parse(char *nmea) {
p += 3; // skip decimal point
strncpy(degreebuff + 2, p, 4);
degreebuff[6] = '\0';
minutes = 50 * atol(degreebuff) / 3;
minutes = atol(degreebuff) * 10;
longitude_fixed = degree + minutes;
longitude = longitude_fixed / 100000.0F;

Expand Down

0 comments on commit 7ca1d78

Please sign in to comment.