I have an Adafruit Ultimate GPS connected to a MEGA2560. I am trying to get the data from the buffer and do other data processing at the same time, however. when i allow other processing to be done the output becomes garbled such as below. the first out is correct and then becomes garbled and outputs now useful data.
16:34:54.466 -> $GPGGA,163453.155,,,,,0,00,,,M,,M,,*7F
16:34:57.111 -> $GPRMC,163453.155,V,,,,$GP$GPGGA,1$GPGGA,$GPGGA
void loop()
{
GetTotalPressure();
char c = GPS.read();
Serial.print(c);
if (GPS.newNMEAreceived()) {
if (!GPS.parse(GPS.lastNMEA())) // this also sets the newNMEAreceived() flag to false
return; // we can fail to parse a sentence in which case we should just wait for another
}
if (timer2 > millis()) timer2 = millis();
if (millis() - timer2 > 1000) {
timer2 = millis(); // reset the timer
GPSScreenUpdate();
SDcardSave();
}
When GetTotalPressue is commented out The GPS serial output is correct when it is no the error above happens.
GetTotalPressure is below the sensor is connected to a I2C bus
void GetTotalPressure() {
Totalpressure = ms5611.readPressure();
Many Thanks