Arduino GPS code displaying duplicate data.

So, I’m trying to make a GPS data logger and everything works well except I get a duplicate longitude and latitude data every update. I don’t know why this is so if you can help, that would be great!

#include <TinyGPS++.h>
#include <SoftwareSerial.h>

static const int RXPin = 5, TXPin = 16;
static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);

void setup(){

void loop(){
  // This sketch displays information every time a new sentence is correctly encoded.
  while (ss.available() > 0){
    if (gps.location.isUpdated()){
      Serial.print("Latitude= "); 
      Serial.print(, 6);
      Serial.print(" Longitude= "); 
      Serial.print(gps.location.lng(), 6);
      Serial.print(" ");
      //printDateTime( , gps.time);
      if (gps.speed.isUpdated()) {

static void printDateTime(TinyGPSDate &d, TinyGPSTime &t)
    char sz[32];
    sprintf(sz, "%02d/%02d/%02d ", d.month(),, d.year());
    sprintf(sz, "%02d:%02d:%02d ", t.hour(), t.minute(), t.second());
    Serial.print(sz); //return the decoded data in console.

The GPS sends an updated position fix in both the GPRMC and GPGGA senetances, so that is reported by the software.

Only the GPRMC sentence has the speed.

Details here;