Skip to content

Commit

Permalink
Fix #22 by adding 1hz and 5hz position fix update commands. Update ec…
Browse files Browse the repository at this point in the history
…ho example to show command usage.
  • Loading branch information
tdicola committed Aug 7, 2014
1 parent deef2c0 commit 11cb409
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Adafruit_GPS.h
Expand Up @@ -29,9 +29,15 @@ All text above must be included in any redistribution
#endif

// different commands to set the update rate from once a second (1 Hz) to 10 times a second (10Hz)
// Note that these only control the rate at which the position is echoed, to actually speed up the
// position fix you must also send one of the position fix rate commands below too.
#define PMTK_SET_NMEA_UPDATE_1HZ "$PMTK220,1000*1F"
#define PMTK_SET_NMEA_UPDATE_5HZ "$PMTK220,200*2C"
#define PMTK_SET_NMEA_UPDATE_10HZ "$PMTK220,100*2F"
// Position fix update rate commands.
#define PMTK_API_SET_FIX_CTL_1HZ "$PMTK300,1000,0,0,0,0*1C"
#define PMTK_API_SET_FIX_CTL_5HZ "$PMTK300,200,0,0,0,0*2F"
// Can't fix position faster than 5 times a second!


#define PMTK_SET_BAUD_57600 "$PMTK251,57600*2C"
Expand Down
6 changes: 6 additions & 0 deletions examples/echo/echo.pde
Expand Up @@ -70,12 +70,18 @@ void setup()
//GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_ALLDATA);

// Set the update rate
// Note you must send both commands below to change both the output rate (how often the position
// is written to the serial line), and the position fix rate.
// 1 Hz update rate
//GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);
//GPS.sendCommand(PMTK_API_SET_FIX_CTL_1HZ);
// 5 Hz update rate- for 9600 baud you'll have to set the output to RMC or RMCGGA only (see above)
GPS.sendCommand(PMTK_SET_NMEA_UPDATE_5HZ);
GPS.sendCommand(PMTK_API_SET_FIX_CTL_5HZ);
// 10 Hz update rate - for 9600 baud you'll have to set the output to RMC only (see above)
// Note the position can only be updated at most 5 times a second so it will lag behind serial output.
//GPS.sendCommand(PMTK_SET_NMEA_UPDATE_10HZ);
//GPS.sendCommand(PMTK_API_SET_FIX_CTL_5HZ);

// Request updates on antenna status, comment out to keep quiet
GPS.sendCommand(PGCMD_ANTENNA);
Expand Down

0 comments on commit 11cb409

Please sign in to comment.