Sean's Carneys GPS - problems with code or library


I'm new to the forum, so i'm not allowed to use the forum-tools as active links and such yet - so i'm sorry about the need to copy and paste. And now to the question.

Has anybody tried to build Sean Carney's excellent GPS-reciever???... as I'm not allowed to paste code or active links, then I have to refer to google, and use the following keywords – “Sean Carney GPS”. It will then be the first link on the list (again – sorry about this).

It uses the NewSoftSerial- and TinyGPS-library, and i have downloaded the newest version today (TinyGPS 9 and NewSoftSerial 10c), and i'm using this with Arduino IDE 0021.

BUT... i can't get Sean Carney's code to work - i keep getting the error...

gpsSystem2_0:68: error: 'NewSoftSerial' does not name a type gpsSystem2_0.cpp: In function 'void setup()': gpsSystem2_0:101: error: 'nss' was not declared in this scope gpsSystem2_0.cpp: In function 'bool feedgps()': gpsSystem2_0:1082: error: 'nss' was not declared in this scope

But funny enough i have succeded in compiling it once, in between getting the error above - but i was so anxious in finding the error, that i did'nt upload the code to the Arduino at the time. Now i'm stuck... i can't find out, why i get the error as well as why it suddenly compiled once - so if anybody has a good idea, it would be nice to see...

Either the error lies in the code (which i presume), or the error lies in the library - or maybe in the IDE itself (as it was able to compile once). It's kind of frustrating, as my hardware is ready to be tested, but i can't get the code to work - even more when i'm kind of a "hardware"-guy, more than a programmer... but I might eventually get it might get to work!! :-)

If it compiled once, it will compile again. You must have moved/deleted a file in between.

Where did you put NewSoftSerial? What is in the NewSoftSerial directory? What OS are you using? What version of the IDE?

Oh sorry…

I forgot to mention that the compiler stops at the line “NewSoftSerial nss (3, 2);”.

The first part of the code is here…


/* Keys
/      1
/  4  3 0
/      2

#include <SoftwareSerial.h>
#include <TinyGPS.h>
#include <LiquidCrystal.h>
#include <EEPROM.h>
#include <math.h>

byte upArrow[8] = {

byte downArrow[8] = {

byte degree[8] = {

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

int adcKeyIn;
int NUM_KEYS = 5;
int key=-1;
int oldKey=-1;
int  adcKeyVal[5] ={30, 150, 360, 535, 760 };

// Options

boolean useCurrentSpeed = 0;
boolean useDirections = 0;
boolean useAbsoluteHeadings = 0;
byte timeZone = 0;

TinyGPS gps;
NewSoftSerial nss(3, 2);

// Maximum speed and last known position
float maxSpeed = 0;
float lastFlat = 0;
float lastFlon = 0;

// Default location to navigate from
float targetFlat = 49.88622;
float targetFlon = -97.15256;

// To track time elasped for average speed calculation
byte startHour = 0;
byte startMinute = 0;
byte startSecond = 0;

// Default menu choice
byte screen = 2;
byte lastScreen = 4;

boolean start = 1;
boolean useDegrees = 1;
long distance = 0;

const int DEBOUNCE_DELAY = 50;
byte screenRefresh = 120;

void gpsdump(TinyGPS &gps);
bool feedgps();
void printFloat(double f, int digits = 2);

void setup() { 
  pinMode(13, OUTPUT);  //we'll use the debug LED to output a heartbeat

  lcd.createChar(0, upArrow);
  lcd.createChar(1, downArrow);
  lcd.createChar(2, degree);
  lcd.begin(16, 2);

This isn't a code issue. It's an installation issue.

-> Paul S

Actually i also thought this - but no...

I keep getting the error, even if i try downloading the code again.

Link to Sean Carney's project is here...

I now think the problem lies within the IDE, as i just recall that it compiled, while i was using Ubuntu 10.04 partition on the pc. Right now i'm using Windows XP, and the i keep getting the error right now - and now i'm using Windows XP.

Unfortunatly that leaves me no better, as i suddenly keep getting another error on the Ubuntu partition (AVR programmer not responding), but thats another thing.

Right now i'm concentrating on this problem. I'm using Arduino 0021 for Windows, and i have put the NewSoftSerial library in the libraries folder in the Arduino folder - and it's visible in the Sketch->Import Library

The NewSoftSerial-library contains NewSoftSerial.cpp, NewSoftSerial.h, keywords.txt and some examples for use in a folder.

Ahh... sorry, sorry sorry... :-[

It's compiled...

Actually while looking at the code on the forum, i could see the error right away. It wasn't the right library, which the code included.

It was the SoftwareSerial-library, and not the NewSoftSerial-library, that was called - hence the error. Amazing... i have looked this over again and again, and i could'nt see the error before now...

I must have typed in the right library in the code by an accident, and just forgot about it, while trying to find out why the code would'nt compile. Thanks again - and sorry for your time... :-/

Thanks again - and sorry for your time...

No problem. What matters is that you are now making progress.