Shop OBEX P1 Docs P2 Docs Learn Events
Found an error in the GPS_Basic.spin in APP note AN002 — Parallax Forums

Found an error in the GPS_Basic.spin in APP note AN002

w4fejw4fej Posts: 264
edited 2016-03-30 09:49 in Propeller 1
While playing with the new GPS from Parallax I discovered an error in the conversion from meters to feet.

The method "pub n_altf" has the conversion as follows:

Return (n_altm * 3048 / 10_000)

The computation should be :

Return (n_altm * 10_000 / 3048)

To check this use this test:

10668 meters SHOULD yield exactly 35_000 feet but instead yields 3_251.6

Using the other computation does indeed yield 35_000.

Mike B.

Comments

  • PublisonPublison Posts: 12,366
    edited 2014-09-27 08:30
    Could you indicate which GPS Object you are referring to? A search for "GPS_Basic.spin" in the OBEX does not produce any results. Did you notify the author?
  • PublisonPublison Posts: 12,366
    edited 2014-09-27 08:34
    Are you referring to Application Note AN002? Which is not in the OBEX.
  • w4fejw4fej Posts: 264
    edited 2014-09-27 09:35
    Publison wrote: »
    Are you referring to Application Note AN002? Which is not in the OBEX.

    Sigh...... I had a error in my report of an error!! lol. Yes, indeed it is in the app note, sorry about that...

    Mike B. (Hey, I'm old, cut me some slack !! lol)
  • PublisonPublison Posts: 12,366
    edited 2014-09-27 09:46
    Mike just checking. No need for apologies. I may be older than you! :)

    When I get my workbench cleaned off, (ha), I'll fire up to new GPS.
  • w4fejw4fej Posts: 264
    edited 2014-09-27 09:55
    ". I may be older than you! "

    Perhaps, I'm 70....

    Mike B.
  • JonnyMacJonnyMac Posts: 9,105
    edited 2014-09-27 10:11
    Mea culpa. I wrote that App Note for Ken, and I clearly erred when validating that method. I am sorry. This is how I've corrected my copy of the code:
    pub n_altf
    
    '' Altitude in feet as decimal value
    '' -- 1 foot = 0.3048 meters
    
      return (n_altm * 10_000 / 3_048)                              ' return feet
    


    That was part of Parallax Semiconductor which doesn't exist anymore, so I'm not sure if the App Note is posted anywhere.
  • PublisonPublison Posts: 12,366
    edited 2014-09-27 10:37
    JonnyMac wrote: »


    That was part of Parallax Semiconductor which doesn't exist anymore, so I'm not sure if the App Note is posted anywhere.

    Yup, still in the downloads section, (But it's hard to find).

    http://www.parallax.com/downloads/an002-real-time-gps-data-reception-and-parsing
  • w4fejw4fej Posts: 264
    edited 2014-09-27 11:14
    JonnyMac wrote: »
    Mea culpa. I wrote that App Note for Ken, and I clearly erred when validating that method. I am sorry. This is how I've corrected my copy of the code:
    pub n_altf
    
    '' Altitude in feet as decimal value
    '' -- 1 foot = 0.3048 meters
    
      return (n_altm * 10_000 / 3_048)                              ' return feet
    


    That was part of Parallax Semiconductor which doesn't exist anymore, so I'm not sure if the App Note is posted anywhere.

    Hi Johnny

    The app note is listed on the 28509 info page at the bottom..

    Mike B.
  • App note AN002 still contains an error in GPS_Basic.spin file which is included in the zip file in the altitude meters to feet calculation and the file itself is 5 years out of date.

    Mike B.
  • I sent the corrections to webmaster@parallax.com.

    I the future, if you find an error, you can send it directly to

    webmaster@parallax.com . It will get serviced faster than through the forums.


  • Oh, ok. Learn something new every day. Love it..

    Thanks....
Sign In or Register to comment.