/* This sample code demonstrates the normal use of a TinyGPS object.
It requires the use of SoftwareSerial, and assumes that you have a
4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
*/
void loop()
{
bool newData = false;
unsigned long chars;
unsigned short sentences, failed;
// For one second we parse GPS data and report some key values
for (unsigned long start = millis(); millis() - start < 1000;)
{
while (ss.available())
{
char c = ss.read();
// Serial.write(c); // uncomment this line if you want to see the GPS data flowing
if (gps.encode(c)) // Did a new valid sentence come in?
newData = true;
}
}
OK. On the Mega, if you want to use pins 14 and 15, you should not use software serial, you should use Serial3 instead. Don't forget that RX and TX are crossed over. For example, TX on the GPS module is connected to RX3 (pin15) on the Mega.
What is actually printed alongside pins 14 and 15 is TX3 and RX3
The Mega has 4 hardware serial ports (UARTS) which means that you do not need to use SoftwareSerial. Pins 14 and 15 give you access to Serial3 which you can use exactly the same as a serial port created using SoftwareSerial by using Serial3 as its name