Arduino + GPS Shield

hey guys...

im working right now with a gps shield.. everything its ok but when i enter the cordinations on google maps their are like 10 or 20 miles from my house so do i have to covert the cordinations or something ?

1)SIM548 2)in the same direction 3)im entering the same way that the gps its geving me the cordination 4) like 7 times

But this isn't is the Arduino Psychic Psycho Network. ;D

$GPVTG,152.50,T,,M,0.22,N,0.4,K,A*0A $GPGGA,022306.000,4046.7057,N,07410.5829,W,1,06,1.4,-19.0,M,-34.2,M,,0000*72 $GPGSA,A,3$GPGGA,022307.000,4046.7069,N,07410.5833,W,1,05,1.8,-30.0,M,-34.2,M,,0000*71 $GPGSA,A,3,26,29,05,18,09,,,,,,,,5.9,1.8,5.6*3E $GPRMC,022307.000,A,4046.7069,N,07410.5833,W,0.54,229.00,191010,,,A*79

so do i have to covert them or something like that?

so do i have to covert them or [u]something like that[/u]?

Yeah, go with that - maybe the latter... but then again maybe not. I used to be certain but now I'm not so sure...

G.

You have to convert like this:

4046.7069 / 100 = 40.467069

x = integer part = 40 y = decimal part = 0.467069

latitude = x + (y * 10) / 6 = 40.77845

longtitude = 74.17639

You are here: http://maps.google.com/maps?q=40.77845N,74.17639W

Google NMEA to figure out how the sentences are formatted.

Previous post is wrong; 4046.7 is 40 degrees 46.7 minutes.

-j

The NEMA format is ddmm.mmmmm for degrees and minutes. Google Maps takes dd.ddddd, i.e. just degrees. The above formula I supplied converts degrees and minutes to degrees. I believe it is correct.

Sorry DaveAK, you are correct. I misread.

Your formula is convoluted, though. y*10/6? Why not y/60 ?

-j

Because y in this example is minutes/100, not minutes. So I could do y100/60, or y1.66666, or y/0.6 it’s all the same. (y*10/6 is not the same as y/60 though).

However, the important part to get the NEMA value in to decimal degrees is to break out the degrees and add to it the minutes divided by 60. I was trying to show it pseudo-programatically and there may be a more fancy/simple way of doing it.

4046.7069 / 100 = 40.467069

x = integer part = 40 y = decimal part = 0.467069

latitude = x + (y * 10) / 6 = 40.77845

so for the longitude is the same?

Yup. Same principle. NEMA dddmm.mmmm

74 degrees 10.5833 minutes

07410.5833 / 100 = 74.105833

x = 74, y = 0.105833

longitude = 74 + 0.105833 * 10 / 6 = 74.17639

sorry, but I dislike your obfuscated code, even if it is correct.

If you have dddmm.mmmmm split into ddd and mm.mmm, then convert mm.mmm to .dddd if needed.

Programming rule 1: write code that is correct. Rule 2: write code that is easy to understand and maintain.

Rule 2 is quite nearly as important as Rule 1.

-j

If you have dddmm.mmmmm split into ddd and mm.mmm, then convert mm.mmm to .dddd if needed.

Isn't that what the pseudo-code does? And of course if you don't like it, don't use it. ;)

So a challenge for you. Come up with something better. :)