GPS NMEA output to readable format

Hi, I’m trying to convert NMEA output from an Argent GT-320FW(AS) GPS into something that is easier to read.

The NMEA output reads:


and my code (borrowed liberally from various sources) is

#include <TinyGPS.h>

#include <SoftwareSerial.h>
TinyGPS convert;

#define RXPIN 2
#define TXPIN 6
SoftwareSerial GPS = SoftwareSerial(2,6);

void setup()
  Serial.println("GPS Arduino");
  Serial.println("       ...waiting for lock...           ");
  void loop()
      int c =;
     float latitude, longitude;
   convert.f_get_position(&latitude, &longitude);
   Serial.print("Lat/Long: "); 
   Serial.print(", "); 
   int year;
   byte month, day, hour, minute, second, hundredths;
   Serial.print("Date: "); Serial.print(month, DEC); Serial.print("/"); 
  Serial.print(day, DEC); Serial.print("/"); Serial.print(year);
  Serial.print("  Time: "); Serial.print(hour, DEC); Serial.print(":"); 
  Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC); 
  Serial.print("."); Serial.println(hundredths, DEC);
   Serial.print("Satellites: ");

but it outputs

0Lat/Long: 1000.00000, 1000.00000
Date: 0/0/2000 Time: 198:96:72.95
Satellites: 255
0Lat/Long: 1000.00000, 1000.00000
Date: 0/0/2000 Time: 198:96:72.95
Satellites: 255

Is there something wrong with my code, or is the GPS not working?

Thank you for the help!

You read a character from the GPS. You supply that character to the GPS library, and it tells you whether that completes a sentence, or not. Regardless of what the library says, you assume that it has a complete sentence, and you extract all the data from the usually incomplete sentence. How is that working? Never mind, I already know.

Is there something wrong with my code

Well, yeah.


Why are you printing this value? Why are you NOT using the value in a if statement, to determine whether or not to execute the rest of the code? Extracting data from incomplete sentences is pointless.

Here is a working example - stuffing gps data into variables -