From 2a4c9fa5da5ae92b3d277e1cd41a5b86ae8dbcd1 Mon Sep 17 00:00:00 2001 From: Stanley Huang Date: Fri, 26 May 2017 15:10:15 +1000 Subject: Increased coordinates precision --- libraries/TinyGPS/TinyGPS.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libraries') diff --git a/libraries/TinyGPS/TinyGPS.cpp b/libraries/TinyGPS/TinyGPS.cpp index a3f5a1e..5a5b86b 100644 --- a/libraries/TinyGPS/TinyGPS.cpp +++ b/libraries/TinyGPS/TinyGPS.cpp @@ -143,18 +143,18 @@ unsigned long TinyGPS::parse_degrees() { char *p; unsigned long left = gpsatol(_term); - unsigned long tenk_minutes = (left % 100UL) * 10000UL; + unsigned long tenk_minutes = (left % 100UL) * 100000UL; for (p=_term; gpsisdigit(*p); ++p); if (*p == '.') { - unsigned long mult = 1000; + unsigned long mult = 10000; while (gpsisdigit(*++p)) { tenk_minutes += mult * (*p - '0'); mult /= 10; } } - return (left / 100) * 100000 + tenk_minutes / 6; + return (left / 100) * 1000000 + tenk_minutes / 6; } #define COMBINE(sentence_type, term_number) (((unsigned)(sentence_type) << 5) | term_number) -- cgit v1.2.3