By calling atof() on p, we're converting the entire time string (101520.123 for 10:15:20am and 123 milliseconds) to a float, then multiplying by 1000 to get ms. This results in a value that overflows and exhibits all sorts of strange behavior as seconds and minutes turn over. It's clearly not what was intended. From the if statement wrapping the conversion, it is clear that the author intended to make the atof() conversion on the dec pointer, instead. Making this change actually does fix the parsing so that Adafruit_GPS' milliseconds property correctly matches the value in the NMEA sentence. You guys do great work. Thanks for everything! |
||
|---|---|---|
| .github | ||
| examples | ||
| src | ||
| .gitignore | ||
| README.md | ||
| code-of-conduct.md | ||
| keywords.txt | ||
| library.properties | ||
| license.txt | ||
README.md
Adafruit_GPS 
This is the Adafruit GPS library - the ultimate GPS library for the ultimate GPS module!
Tested and works great with the Adafruit Ultimate GPS module using MTK33x9 chipset ------> http://www.adafruit.com/products/746
These modules use TTL serial to communicate, 2 pins are required to
interface.
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information
All text above must be included in any redistribution
To install, use the Arduino Library Manager to search for 'Adafruit GPS' and install the library.