I currently have an Uno project that requires my GPS module (
Adafruit GPS Shield) to run at 57600 baud.
As every time the Arduino is un-powered it resets back to 9600 (pretty sure it doesn't have an EEPROM), I have been using this code (edited from something courtesy of
adafruit_support_rick) to turn it back to 57600;
#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(8, 7);
Adafruit_GPS GPS(&mySerial);
void setup()
{
// 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800
GPS.begin(9600);
// GPS.sendCommand(PMTK_SET_BAUD_115200); //set baud rate to 115200 hopefully!
GPS.sendCommand("$PMTK251,57600*2C"); //set baud rate to 57600
// GPS.sendCommand(PMTK_SET_BAUD_57600); //set baud rate to 57600
// GPS.sendCommand("$PMTK2u51,38400*27"); //set baud rarte to 38400
// GPS.sendCommand("$PMTK251,19200*22"); //set baud rate to 19200
// GPS.sendCommand("$PMTK251,9600*17"); //set baud rate to 9600
mySerial.end();
delay(500);
GPS.begin(57600);
}
void loop(){
}
I'd like to put the baud change code into the setup of my
actual code though, and I'm unsure how to do so with different library's to those above.
How could I change the baud rate using just NMEAGPS.h and GPSPort.h?
Thank you in advance.
----------------------------------
EDIT: In the GPSPort header it defaults to using AltSoftSerial, which are pins 8 and 9 on the Uno. The GPS shield is set to using 7 and 8 when on soft serial mode... In testing I have had them working together at 9600, I don't understand how two different sets of rx ant tx pins can communicate?