I've got the code working w/o the commands on a Neo-6m and Neo-7n. Serial monitor shows the data, 1Hz and 10Hz respectively. When I enable the BAUD command, I get no serial data. When I enable the RATE command, the frequency doesn't change. I tried 2 different formats for the commands. Chip is a Pro Mini connected via FTDI cable.
I suspect this relates to using AltSoftSerial. I'd like to keep using pins 8 & 9 because I plan on using a bluetooth device to relay serial data. I'm not sure how I can have AltSoftSerial send the serial data to the BT module via pins 8 & 9 while communicating with the GPS via Rx/Tx pins. This sort of code is still a bit mysterious to me.
Am I correct that I'd change "AltSoftSerial gpsPort" to something like "AltSoftSerial serialforbluetooth" & send serial data via "serialforbluetooth.print( fix.satellites );"?
#include <NMEAGPS.h>
#include <AltSoftSerial.h>
AltSoftSerial gpsPort; // GPS TX to pin 8, GPS RX to pin 9
NMEAGPS gps;
void setup()
{
Serial.begin(9600);
gpsPort.begin(9600);
// while (!Serial)
// ;
// gps.send_P( &gpsPort, F("PMTK251,38400") ); // set baud rate
gpsPort.println("$PMTK251,38400*22"); // a different method I saw on the forums
gpsPort.flush(); // wait for the command to go out
delay( 100 ); // wait for the GPS device to change speeds
gpsPort.end(); // empty the input buffer, too
gpsPort.begin( 38400 ); // use the new baud rate
gps.send_P( &gpsPort, F("PMTK220,200") ); // set 5Hz update rate
// gpsPort.println("$PMTK220,500*2B"); // a different method I saw on the forums
Serial.println( F("GPS Start") ); // F macro saves RAM
}
void loop()
{
if (gps.available( gpsPort ))
{
//Get the latest info from the gps object which it derived from the data sent by the GPS unit
gps_fix fix = gps.read();
Serial.print( F("Satellite Count:") );
if (fix.valid.satellites)
Serial.print( fix.satellites );
Serial.print( F("\nLatitude:") );
if (fix.valid.location)
Serial.print( fix.latitude(), 6 );
Serial.print( F("\nLongitude:") );
if (fix.valid.location)
Serial.print( fix.longitude(), 6 );
Serial.print( F("\nSpeed MPH:") );
if (fix.valid.speed)
Serial.print( fix.speed_mph() );
// Serial.print( F("\nAltitude Meters:") );
// if (fix.valid.altitude)
// Serial.print( fix.altitude());
Serial.print( F("\nHeading:") );
if (fix.valid.heading)
Serial.print( fix.heading() );
Serial.print( F("\nMinutes:") );
if (fix.valid.time){
Serial.print(fix.dateTime.minutes);
Serial.print( F("\nSeconds:") );
Serial.print(fix.dateTime.seconds);
}
Serial.println();
}
}
FYI the whole reason I'm doing this is because I'd prefer 5 or 10Hz for the 6m, but it's not saving the settings from u-center for long periods. Also thanks for any ideas & help.

