Adafruit GPS Library

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
johnover
 
Posts: 18
Joined: Mon Nov 14, 2011 6:23 pm

Adafruit GPS Library

Post by johnover »

Got my new ultimate GPS breakout shield and man... It is slick! I especially like the GPS library that comes with. I am working on a project that is going to contain several sensors, so I want to be very careful with memory. I'd like to make sure I have a GPRMC string, parse it from the GPS, and write it to SDCard. I've noticed in the header files there is a GPS.waitForSentence(String) where I can pass in "$GPRMC" but what I can't see is how I can use the GPS.* library to get the full NMEA string. It's a waste of memory to parse the string all over again...

My logic is somethling like this pseudocode:
if (GPS.newNMEAreceived())
{
GPS.parse(GPS.lastNMEA()); // Read the string
GPS.<here's where i want to just get the NMEA string>
}

I can't find a command in the header to do this, so is my only option to approach this the other way? Do I have to keep parsing the serial port looking for $GPRMC?

Thanks!

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit GPS Library

Post by adafruit_support_mike »

The simplest solution would be to tell the GPS module only to send $GPRMC sentences at the rate you want them.

The commands to do that are listed in the module's documentation (pages 12 and 13):
http://www.adafruit.com/datasheets/PMTK_A11.pdf

User avatar
johnover
 
Posts: 18
Joined: Mon Nov 14, 2011 6:23 pm

Re: Adafruit GPS Library

Post by johnover »

Mike, thanks - that did it. In fact, there's a string in the header to do it (I'd only opened one of the GPS support files):
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);

Then sending the following command disabled the PGTOP messages:
GPS.sendCommand(PGCMD_NOANTENNA);

Now I'm simply working on cutting my memory use. GPS uses a lot of memory. I may ultimately end up simply parsing pointers, but this is a good beginning for sure.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”