mikalhart / TinyGPSPlus

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

What if I can't use TX2 and RX2 ? #60

Closed GeorgeFlorian closed 5 years ago

GeorgeFlorian commented 5 years ago

Hello !

I have a ESP32 Wrover-B DevKitV4 and it's GPIO 16 and 17 are disabled from factory. I can't use TX and RX, because nobody can. I've tried and I can't upload any sketch on it: A fatal error occurred: Failed to write to target RAM (result was 01070000)

What can I do in this case ? Can't I use other pins ?

GeorgeFlorian commented 5 years ago

I've finally found my answer and I can use other pins !

Like this:

#define RX2 26
#define TX2 27
HardwareSerial SerialGPS(1);
TinyGPSPlus gps;

void setup() {
SerialGPS.begin(9600, SERIAL_8N1, RX2, TX2);

  while (SerialGPS.available() > 0) {
    gps.encode(SerialGPS.read());
  }
}