mikalhart / TinyGPSPlus

A new, customizable Arduino NMEA parsing library
http://arduiniana.org
1.05k stars 486 forks source link

Two Serial ports #83

Open sbonaime opened 3 years ago

sbonaime commented 3 years ago

Hi, I wand to use a GPS and another Serial sensor. I use two SoftwareSerial. How tinyGPSPlus is linked to the right Serial ?

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

static const int RXPin = 4, TXPin = 3;
static const int RXPin2 = 14, TXPin2 = 15;
static const uint32_t GPSBaud = 4800;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial serialGPS(RXPin, TXPin);
SoftwareSerial otherSerialsensor(RXPin2, TXPin2);
andbe-gh commented 3 years ago

Hi, you just forget to add the '2's in line 5.