TinyGPS 12 released

There's a new version of TinyGPS, my NMEA (GPS) stream parser library, available. Version 12 provides some simplified new examples and several new features:

satellites() – Number of satellites counter from $GPRMC
hdop() – Horizontal Dilution of Precision from $GPRMC — the smaller this value is the more confidence you have in the accuracy of the location reading.
course_to() – another Maarten Lamers’ borrowing that complements his distance_to() function
cardinal() – a nice little static function by Matt Monson that converts a course to a compass direction like “SSE”.

Mikal

I am definitely going to give this library a try! I was wanting to have a solution like Cardinal(). It would be much better than course numbers for me.

Thanks for sharing.

Hi Mikal,
Thank you for writing this library.
I am having a bit of a problem that I hope you can help with. I am using an arduino uno and a venus gps module. I seem to get valid NMEA sentences and I get good readouts for Lat, Long, altitude, time, and (sometimes) date (they change as I walk around with the gps and the lat/long resolves to my current location). I cannot get readouts for course or speed no matter what I do. If I send the value to the serial monitor it shows 1000.0 for course and -1 for speed.

I looked at the .cpp file and realized that 1000 and -1 represent invalid data for those functions. But I don't understand why I am getting invalid data.

Could you offer some advice as to what might be the problem? Thanks.

Shotline:
Hi Mikal,
Thank you for writing this library.
I am having a bit of a problem that I hope you can help with. I am using an arduino uno and a venus gps module. I seem to get valid NMEA sentences and I get good readouts for Lat, Long, altitude, time, and (sometimes) date (they change as I walk around with the gps and the lat/long resolves to my current location). I cannot get readouts for course or speed no matter what I do. If I send the value to the serial monitor it shows 1000.0 for course and -1 for speed.

I looked at the .cpp file and realized that 1000 and -1 represent invalid data for those functions. But I don't understand why I am getting invalid data.

Could you offer some advice as to what might be the problem? Thanks.

I would suggest trying to capture the full nmea output from your gps to a text file and attaching it to your question, also posting it in the Programming forum might be more appropriate. My initial guess is that your gps is not output the sentences that the library is using for course and speed.

Hi Mikal and all,

I am thinking of modifying the TinyGPS code to include information about the number of visible satellites.
Looking at the c++ code, I am very confused about how to do it.

Here is my initial thoughts:

int TinyGPS::f_numsats()
{
return _numsats == GPS_INVALID_SATELLITES ? GPS_INVALID_SATELLITES : _numsats;
}

Would that work?

As of this edit: The above code works. Do remember to add int f_numsats(); into the TinyGPS.h file too.

Would that work?

What's going to happen after the first call when there are no satellites? Why does the function assign a new value to _numsats? It should not. It should simply return the value that is in _numsats. That value should be set to the number of satellites the device reports seeing, or to GPS_INVALID_SATELLITES, by the code that parses the sentences that contain the number of satellites.