Shop OBEX P1 Docs P2 Docs Learn Events
GPS troubles — Parallax Forums

GPS troubles

Van DesselVan Dessel Posts: 15
edited 2010-01-13 03:21 in Propeller 1
I'm currently working on a project that finds the latitude and longitude and stores the information on a data logger.
I got everything working properly except that the latitude and longitude isn't accurate enough; 72 dgrees longitude could be anywhere from boston to 100 miles in!!freaked.gif· I was wondering if this is just a limitation of my gps (PMB-248 GPS reciever from parallax) or is my code missing something.

gps.readNEMA                            'Finds an NEMA string
lights(1)

USB.OpenForWrite(string("data.txt"))    'Writes to the data.txt file and records        
USB.WriteLine(string("longitude is..."))         
USB.WriteLine(num.ToStr(atoi(gps.longitude,3),Num#DEC3))
USB.WriteLine(string("Latitude is..."))
USB.WriteLine(num.ToStr(atoi(gps.latitude,2),Num#DEC3))

I'm using GPS_IO_Mini_PNAV thats slightly different·as an object to read the incoming data and Numbers to create the string.

Thanks

Comments

  • kf4ixmkf4ixm Posts: 529
    edited 2010-01-13 02:16
    im new to prop programming, so take this with a grain of salt, but from looking at the code im thinking the DEC3 should be a higher value, like DEC6, this would give you a 6digit varible string instead of trunctuating the data to just the first 3 digits. maybe someone with more prop experience can verify this, or debunk as the case may be.
  • Van DesselVan Dessel Posts: 15
    edited 2010-01-13 02:22
    I tried a higher value however it then just fills with zeros. so DEC8 gave me 00000072 or something similar to that
  • jcwrenjcwren Posts: 44
    edited 2010-01-13 02:26
    I'm new to all this too, but if your latitude is 34.172656 and you're using atoi() (Alpha to INTEGER), what's the integer value of 34.172656?

    --jc
  • kf4ixmkf4ixm Posts: 529
    edited 2010-01-13 02:27
    did you try changing the varible (atoi(gps.longitude,3) to something like (atoi(gps.longitude,6)?
  • Van DesselVan Dessel Posts: 15
    edited 2010-01-13 03:16
    thanks kf4ixm i over looked that. now it works!! thanks
  • kf4ixmkf4ixm Posts: 529
    edited 2010-01-13 03:21
    anytime, glad to be of help! yeah.gif
Sign In or Register to comment.