GPS metric to your kind
G'day folks,
I'm reading nmea from a gps and its metric ie 27.407544 which should be 27.404544.
Is there an easy way to do this calculation? Or is there a standard way to change output format on the gps? (its rs232)
If someone wants to get in depth, its on a SX28.
Thanks for any help!
Michael.
I'm reading nmea from a gps and its metric ie 27.407544 which should be 27.404544.
Is there an easy way to do this calculation? Or is there a standard way to change output format on the gps? (its rs232)
If someone wants to get in depth, its on a SX28.
Thanks for any help!
Michael.
Comments
If you had 27.5000 that would be 27 and a half degrees, which is 27 degrees and 30 minutes. You take away the 27 degrees, and multiply the remainder by 60 (.5*60 = 30). You'll have to store the minutes and seconds separately from the degrees (that is, three separate variables), and then put them back together in your display code.
If you had 27.5050, you'd take away the 27 and store it in your degrees variable, multiply the .5050 by 60 to get 30.3, put the 30 in your minutes variable, and multiply the .3 by 60 to get 18 seconds to store in your seconds variable.
Now the numbers you give in the example look a little odd. If your problem is purely the decimal<->ddmmss conversion, why is the ".40" part the same in both? I'm not sure what's going on there.
Post Edited (sylvie369) : 9/16/2008 11:57:02 AM GMT
Thanks for your idea, i think it will be the way to go. Its good to see you still know what i'm talking about even with my bad information.
Cheers!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering