Good Day,
I am having some weird issues with a GPS based project. I am using an Adafruit Ultimate GPS breakout and an UNO. My code was made using tutorials I found online. It is supposed to read the GPS GPRMC sentence and then print it onto the serial monitor. It actually works, but I am getting extra spaces in the data. On top of that every time it prints the data to the serial monitor it also reprints what it is supposed to print only once from the setup loop. Am I missing something obvious?
Code:
#include <Adafruit_GPS.h> //include library
#include <SoftwareSerial.h> //include library
SoftwareSerial mySerial(3, 2); //for GPS module (leave serial port for use
Adafruit_GPS GPS(&mySerial); //GPS connection
byte byteGPS = 0;
int i = 0;
int h = 0;
char inBuffer[300] = "";
char GPS_RMC[100] = "";
void setup()
{
Serial.begin(9600);
GPS.begin(9600);
Serial.println("GPS Sentence Test");
Serial.flush();
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);
}
void loop()
{
byteGPS = 0;
byteGPS = GPS.read();
while(byteGPS != 'R')
{
byteGPS = GPS.read();
}
GPS_RMC[0]='
Any help would be greatly appreciated!
Cheers,
Berg;
GPS_RMC[1]='G';
GPS_RMC[2]='P';
GPS_RMC[3]='R';
i = 4;
while(byteGPS != '*')
{
byteGPS = GPS.read();
inBuffer[i]=byteGPS;
GPS_RMC[i]=byteGPS;
i++;
}
Serial.print("RMC sentence: ");
h = 0;
while(GPS_RMC[h] != 42)
{
Serial.write(GPS_RMC[h]);
h++;
}
Serial.println();
delay(1000);
}
Any help would be greatly appreciated!
Cheers,
Berg


