Shop OBEX P1 Docs P2 Docs Learn Events
NEW: GPS Smart Mode Object — Parallax Forums

NEW: GPS Smart Mode Object

DrGaryDrGary Posts: 7
edited 2007-06-11 05:40 in Propeller 1
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

Comments

  • KaioKaio Posts: 253
    edited 2007-06-09 21:48
    Gary,

    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
  • DrGaryDrGary Posts: 7
    edited 2007-06-11 05:40
    Thanks. The idea for the single pin FullDuplexSerial use comes from Parallax's Chris Savage, found in this thread.

    Yup, good tip regarding storing the "!GPS" command header in a DAT section instead of repeating it. Saves a few bytes needed elsewhere...


    --Gary
Sign In or Register to comment.