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

const int TX_Pin = 4; // these are the digital pins which the corresponding GPS RX or TX is connected to
const int RX_Pin = 3;

TinyGPSPlus gps;  

SoftwareSerial ss(TX_Pin, RX_Pin);

void setup(){
  Serial.begin(9600);
  ss.begin(9600); // this is the GPS baud rate most GPS's use a baud rate of 9600 but double check your actual GPS buad rate
  Serial.print("Starting");
}

void loop(){
  while (ss.available() > 0){ //if the GPS is supplying data enter the loop
  gps.encode(ss.read()); 
  if (gps.location.isUpdated()){ //if the supplied data is updated proceed to the next step
    Serial.print("Latitude= "); 
    Serial.print(gps.location.lat(), 6); //reads and prints the data
    Serial.print(" Longitude= "); 
    Serial.println(gps.location.lng(), 6); //reads and prints the data
  }
  }
}
