Arduino Forum

Products => MKR Boards => MKRGSM1400 => Topic started by: alphacat92 on Mar 23, 2019, 01:20 pm

Title: TinyGPS++ library
Post by: alphacat92 on Mar 23, 2019, 01:20 pm
Hello, I'm having a lot of trouble using the TinyGPS++ library with the MKR GSM 1400. I understand that the MKR does not have software serial capabilities so I've been trying to get the library to work using hardware serial. Here is my code, but when I connect it properly I don't get output. I tested it with a Nano and it worked:
Code: [Select]

#include <TinyGPS++.h>

//Initialize TinyGPS++ object
TinyGPSPlus gps;

void setup() {
  //while (!Serial);

void loop() {
  while (Serial.available() > 0)
    if (gps.encode(
      if (gps.location.isValid())
        Serial.print(, 6);
        Serial.print(", ");
        Serial.print(gps.location.lng(), 6);
        delay (1000);
Title: Re: TinyGPS++ library
Post by: sandeepmistry on Mar 25, 2019, 01:07 pm
If you are using the TX/RX pins on the headers, you must use Serial1 instead of Serial. Serial is for the USB serial.