Shop OBEX P1 Docs P2 Docs Learn Events
GPS and FPU V3 — Parallax Forums

GPS and FPU V3

halfblinddadohalfblinddado Posts: 59
edited 2009-02-09 04:33 in BASIC Stamp
How can I take the output data from the GPS module and input it to the FPU for processing?

Specifically I would like to take the floating point value of the longitude and latitude such as 36.6968 and -118.059 then do calculations like atan, atan2 etc..

Thanks,

Comments

  • rixterrixter Posts: 95
    edited 2009-02-09 01:26
    Is your question more about reading a GPS module or dealing with the data that you extract from the device? I'm guessing that you're wondering how to crunch the data you read.

    I don't imagine you're going to have a fun time doing this because the BASIC Stamp isn't a floating point math champion and in fact only does integer math unless you want to work with the */ operator to get fractions. I've not found it to be too smooth. The ATN command is used to return Arctangent, but it works with signed integer byte values from -127 to 127. Even the integer part of a GPS coordinate can be larger than 127.

    But I've learned never to say "never" with the BASIC Stamp. There may be some way to split up the longitude and latitude values for ATN crunching then add up the values for the overall result.

    Rick
  • halfblinddadohalfblinddado Posts: 59
    edited 2009-02-09 04:33
    Rich,

    Actually I bought the FPU to do the math. What I am having trouble with is how to get the output from the GPS unit into the FPU for processing. I was thinking maybe I could turn it into a string then use the ATOF command in the FPU. Seems like there should be a better way.

    Mike
Sign In or Register to comment.