Bug in GPS Module demo code?
Parallax provides demo code in the GPS Module manual here and as a separate file here.
But it looks like there's a bug in that code. In the function "Location_Lags:", date rollbacks are applied when the local time is on the previous day compared to the UTC time returned by the GPS module. On line 322, the month is set to January when the year has been rolled back. That's incorrect. When it's 1am on January 1 in Greenwich, it will be December 31 anywhere in the US. The month should be rolled back to December. Line 322 should be "month = 12".
--Gary
But it looks like there's a bug in that code. In the function "Location_Lags:", date rollbacks are applied when the local time is on the previous day compared to the UTC time returned by the GPS module. On line 322, the month is set to January when the year has been rolled back. That's incorrect. When it's 1am on January 1 in Greenwich, it will be December 31 anywhere in the US. The month should be rolled back to December. Line 322 should be "month = 12".
--Gary
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support