Merge pull request #174 from ladyada-eagleclaw/fix-flash-gps-commands

Allow GPS commands to be stored in flash
This commit is contained in:
Limor "Ladyada" Fried authored and GitHub committed 2026-09-15 10:57:05 -04:00
commit 6c9aba2fa8
3 files changed
+13 -4

No files matched your search

+4 -4
View File
@@ -117,16 +117,16 @@ void setup() {
GPS.begin(9600);
// uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
GPS.sendCommand(F(PMTK_SET_NMEA_OUTPUT_RMCGGA));
// uncomment this line to turn on only the "minimum recommended" data
//GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);
//GPS.sendCommand(F(PMTK_SET_NMEA_OUTPUT_RMCONLY));
// For logging data, we don't suggest using anything but either RMC only or RMC+GGA
// to keep the log files at a reasonable size
// Set the update rate
GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); // 100 millihertz (once every 10 seconds), 1Hz or 5Hz update rate
GPS.sendCommand(F(PMTK_SET_NMEA_UPDATE_1HZ)); // 100 millihertz (once every 10 seconds), 1Hz or 5Hz update rate
// Turn off updates on antenna status, if the firmware permits it
GPS.sendCommand(PGCMD_NOANTENNA);
GPS.sendCommand(F(PGCMD_NOANTENNA));
// the nice thing about this code is you can have a timer0 interrupt go off
// every 1 millisecond, and read data from the GPS for you. that makes the
+8
View File
@@ -392,6 +392,14 @@ char Adafruit_GPS::read(void) {
/**************************************************************************/
void Adafruit_GPS::sendCommand(const char *str) { println(str); }
/**************************************************************************/
/*!
@brief Send a command stored in flash
@param str Command wrapped in F()
*/
/**************************************************************************/
void Adafruit_GPS::sendCommand(const __FlashStringHelper *str) { println(str); }
/**************************************************************************/
/*!
@brief Check to see if a new NMEA line has been received
+1
View File
@@ -101,6 +101,7 @@ public:
size_t write(uint8_t);
char read(void);
void sendCommand(const char *);
void sendCommand(const __FlashStringHelper *);
bool newNMEAreceived();
void pause(bool b);
char *lastNMEA(void);