Hello !
I am working on improving an old project of mine where an arduino Mega listens to ascii data coming from a GPS receiver via a hardware serial port and then stores them to a char array.
What i want to do now is use the stored string for printing the Lat and Lon information. The position of theese info in the string are fixed starting from slot 14 to slot 38.
char RcvdChars[] = {"$GPGGA,083729,3758.1553,N,02332.0806,E,0,00,00.0,18.2,M,34.3,M,,*4E"};
for instance in the above code i would like to print all the way from RcvdChars[14] to RcvdChars[38]
how can i do that ?
I thought that maybe with a for statement like this :
void setup()
{
Serial.begin (9600);
}
void loop ()
{
char RcvdChars [] = "$GPGGA,083729,3758.1553,N,02332.0806,E,0,00,00.0,18.2,M,34.3,M,,*4E";
for (int c=14; c<38; c++)
{
Serial.print (RcvdChars[c]);
}
}
But i am sure that there is a better and probably faster way of doing so.
THANK YOU.