This small sketch uses Serial1, but does not use the TinyGPS library.
Wire your GPS to pins 18 and 19
Pin 18 (Tx) to GPS (Rx)
Pin 19 (Rx) to GPS (Tx).
compile, upload, fire up the Serial Monitor and set it to 115200 baud.
If you see a bunch of garble, send the digits 0 through 4, one at a time, with No Line Ending. When you start seeing GPS sentences, you'll know you have the right baud rate.
unsigned long baud[] = {4800, 9600, 19200, 57600, 115200};
byte indx = 0;
void setup() {
Serial.begin(115200);
Serial1.begin(baud[0]);
inform();
}
void loop() {
if (Serial.available()) {
char ch = Serial.read();
Serial.print("\n*********************************** ");
Serial.println (ch);
if (ch >= '0' && ch <= '4') {
indx = ch - '0';
Serial1.end();
delay(500);
inform();
Serial1.begin(baud[indx]);
}
}
if (Serial1.available()) {
char inbyte = Serial1.read();
Serial.print(inbyte);
}
}
void inform() {
Serial.print("\nGPS serial is set to ");
Serial.print(baud[indx]);
Serial.println(" baud");
}