NEW: GPS Smart Mode Object
DrGary
Posts: 7
Attached is a zip file containing the GPS Smart Mode Object. The object provides access to the Parallax GPS Module's Smart Mode. That is, the object will send commands to the GPS module and parse the results. For example, the object can return position, date and time, number of satellites, speed, and heading.
Features:
- calculates US localized times
- accounts for leap years
- adjusts for Daylight Saving Time, if desired
- wiring diagram included
- includes demos and unit tests
Thus, independent of the positioning abilities, the GPS module can provide an accurate, self-adjusting clock.
The GPS Smart Mode Object demonstrates many techniques such as passing and returning strings. It includes a Calendar object that calculates Daylight Savings Time and includes an Nth day of the month function. It can answer the question, "What date was the 3rd Tuesday in December, 2005?"
The Calendar Object demonstrates a simple Unit Test mechanism, including many tests to validate the calendar calculations.
Comments, suggestions, and improvements welcome!
-- Gary
Features:
- calculates US localized times
- accounts for leap years
- adjusts for Daylight Saving Time, if desired
- wiring diagram included
- includes demos and unit tests
Thus, independent of the positioning abilities, the GPS module can provide an accurate, self-adjusting clock.
The GPS Smart Mode Object demonstrates many techniques such as passing and returning strings. It includes a Calendar object that calculates Daylight Savings Time and includes an Nth day of the month function. It can answer the question, "What date was the 3rd Tuesday in December, 2005?"
The Calendar Object demonstrates a simple Unit Test mechanism, including many tests to validate the calendar calculations.
Comments, suggestions, and improvements welcome!
-- Gary
Comments
very nice code and well documented. It was very interesting for me that you use the FullDuplexSerial driver to receive and transmit on the same pin.
I have a suggestion for an optimization for you. It would be better to declare string constants in the DAT section instead of creating it using the keyword string. This would save some bytes if the constant is used multiple in the code like "!GPS", because the compiler makes no optimization by itself.
Thomas
Yup, good tip regarding storing the "!GPS" command header in a DAT section instead of repeating it. Saves a few bytes needed elsewhere...
--Gary