help with TinyGPSPlus issues

hi i am trying to interface an arduino UNO R3 with a NEO-6M GPS module with the following code, can anyone help?

/*

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

static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);

void setup(){
Serial.begin(9600);
ss.begin(GPSBaud);
}

void loop(){
// This sketch displays information every time a new sentence is correctly encoded.
while (ss.available() > 0){
gps.encode(ss.read());
if (gps.location.isUpdated()){
Serial.print("Latitude= “);
Serial.print(gps.location.lat(), 6);
Serial.print(” Longitude= ");
Serial.println(gps.location.lng(), 6);
}
}
}

And im getting these error messages…

Arduino: 1.8.13 (Windows 10), Board: “Arduino Uno”

C:\Users\joshh\AppData\Local\Temp\cceTINse.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_sketch_feb14a.ino.cpp.o.1961’:

:(.text.startup+0x134): undefined reference to `TinyGPSPlus::TinyGPSPlus()’

C:\Users\joshh\AppData\Local\Temp\cceTINse.ltrans0.ltrans.o: In function `loop’:

C:\Users\joshh\AppData\Local\Temp\arduino_modified_sketch_493503/sketch_feb14a.ino:26: undefined reference to `TinyGPSPlus::encode(char)’

C:\Users\joshh\AppData\Local\Temp\arduino_modified_sketch_493503/sketch_feb14a.ino:29: undefined reference to `TinyGPSLocation::lat()’

C:\Users\joshh\AppData\Local\Temp\arduino_modified_sketch_493503/sketch_feb14a.ino:31: undefined reference to `TinyGPSLocation::lng()’

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Arduino Uno.

any advice would be greatly appreciated :slight_smile:

Your code compiles fine for me.

From the error messages, I suspect that you have a library issue with TinyGPS++ - wrong version or some part of it is missing.

ah ok thankyou :slight_smile: well i have just deleted the library and re added it manually (was added as a ZIP before) and it now compiles fine, but when i go to upload it i get these messages.....

Arduino: 1.8.13 (Windows 10), Board: "Arduino Uno"

Sketch uses 7902 bytes (24%) of program storage space. Maximum is 32256 bytes.

Global variables use 538 bytes (26%) of dynamic memory, leaving 1510 bytes for local variables. Maximum is 2048 bytes.

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM4 -b115200 -D -Uflash:w:C:\Users\joshh\AppData\Local\Temp\arduino_build_551242/sketch_feb15a.ino.hex:i

avrdude: Version 6.3-20190619

Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM4

Using Programmer : arduino

Overriding Baud Rate : 115200

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done. Thank you.

An error occurred while uploading the sketch

That's a loading error, the toolchain can't communicate with your Arduino. Make sure you have selected the right COM port.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.