MrPotatoSatellite:
I get coordinates but they are waaay off.
Have you tried printing the entire string to make sure all of the fields are present? How about pasting the actual string into your post.
I have seen some receivers that leave out some of the stuff. (They just put successive commas without any digits for some of the items, so actual positions of some meaningful fields in the string may be different.)
Like this:
I get stuff like this:
[color=blue]$GPRMC,191834.607,A,3813.9806,N,12237.8049,W,,,141110,,*1C
$GPGGA,191835.607,3813.9749,N,12237.8051,W,0,03,,24.7,M,-24.7,M,,0000*7A
$GPGSA,A,1,25,04,02,,,,,,,,,,,,*1F[/color]
The TinyGPS library seems successful in being able to parse lines with empty fields (at least it works for me with an EM-406A module).
Now, assuming all of the fields that you need are present and are in the expected place in the string so that you can actually get the latitude and longitude numbers from the receiver:
Shouldn't you be checking character 42 in your array (the Fix Quality) and, maybe, characters 44 and 45 (Number of Active Satellites)? I mean, a GPS receiver will spit out messages every second, regardless of conditions. You have to check to see whether they are meaningful, right?
What values, exactly, are you getting for the latitude and longitude items? What is your actual latitude and longitude?
Regards,
Dave
Footnote:
Current Arduino libraries will print floats without the special function in your code. You can reduce source code clutter by just calling Serial.print for your floats.