Try NeoGPS and NeoSWSerial:
#include <NMEAGPS.h>
NMEAGPS gps; // This parses the GPS characters
gps_fix fix; // This holds on to the latest values
// PICK A SERIAL PORT:
// BEST: For a Mega, Leonardo or Due, use the extra hardware serial port
//#define gpsPort Serial1
// 2nd BEST: For other devices, use AltSoftSerial on the required pins
// (8&9 for an UNO)
// #include <AltSoftSerial.h>
// AltSoftSerial gpsPort;
// 3rd BEST: If you can't use those specific pins (are you sure?),
// use NeoSWSerial on any two pins @ 9600, 19200 or 38400
#include <NeoSWSerial.h>
NeoSWSerial gpsPort( 8, 7 ); // Arduino RX pin (to GPS TX pin), Arduino TX pin (to GPS RX pin)
// WORST: SoftwareSerial is NOT RECOMMENDED
//--------------------------
void setup()
{
Serial.begin(115200);
while (!Serial)
;
Serial.print( F("NMEAsimple.INO: started\n") );
gpsPort.begin(9600);
}
//--------------------------
void loop()
{
while (gps.available( gpsPort )) {
fix = gps.read();
Serial.print( F("Location: ") );
if (fix.valid.location)
Serial.print( fix.latitude(), 6 ); // floating-point display
Serial.print( ',' );
if (fix.valid.location)
Serial.print( fix.longitude(), 6 ); // floating-point display
Serial.print( F(", Altitude: ") );
if (fix.valid.altitude)
Serial.print( fix.altitude() );
Serial.println();
}
}
The above sketch is really the NeoGPS example NMEAsimple.ino.
Make sure the GPS TX pin is connected to Arduino pin 8 (the NeoSWSerial receiving pin), and the GPS RX pin is connected to Arduino pin 7 (the NeoSWSerial transmitting pin). The silkscreen on the shield is misleading...
It would be even better to use pins 8 & 9 with AltSoftSerial, but you would have to cut the traces to the "Soft Serial/Direct" switch. Then solder or jumper a wire from GPS TX to Arduino 8, and GPS RX to Arduino 9. SoftwareSerial is very inefficient, because it disables interrupts for long periods of time. This will interfere with other parts of your sketch.
If you want to try it, NeoGPS is available from the Arduino IDE Library Manager, under the menu Sketch -> Include Library -> Manage Libraries. NeoSWSerial from the link above.
Cheers,
/dev