GPS U-Blox Neo M8N parser

Great, thanks for that! One thing I noticed... I would suggest changing your while loop from this

  while(Serial1.available()){
        char c = Serial1.read();
        M8_Gps.encode(c);           
        gpsArray[0] = M8_Gps.altitude;
        gpsArray[1] = M8_Gps.latitude;
        gpsArray[2] = M8_Gps.longitude; 
        gpsArray[3] = M8_Gps.sats_in_use;
	}

to this:

  while(Serial1.available()) {
        char c = Serial1.read();
        if (M8_Gps.encode(c)) {
          gpsArray[0] = M8_Gps.altitude;
          gpsArray[1] = M8_Gps.latitude;
          gpsArray[2] = M8_Gps.longitude; 
          gpsArray[3] = M8_Gps.sats_in_use;
        }
  }

Like many libraries, Gps.encode(c) will return true when a sentence has been completely received. There's no reason to copy the values when any character is received. Not a big deal, unless you're trying to do other things at the same time.

For anyone else landing here, you could also modify TinyGPS.cpp to accept these messages by changing these lines:

#define _GPRMC_TERM   "GNRMC"
#define _GPGGA_TERM   "GNGGA"

Other libraries have similar literals that could also be modified.

The Bad News: they will then ignore the normal GPRMC and GPGGA sentences. If the receiver is not tracking any GLONASS satellites, it would emit GPRMC instead. Adding a check for "GNRMC" or "GPRMC" is not very difficult.

Also, I have just finished implementing the NMEA Talker ID concept in NeoGPS, and it will now accept the "GNRMC" et al. This actually improved the performance by about 10%! Ah, skipping bytes is good... :slight_smile:

Cheers,
/dev