a friend threw this bit of code at me...
/* The char offset apparently: 1st line of packet..read down for offset
* 18, 26, 30, 39
* $GPGGA,000301.042,0000.0000,N,00000.0000,E,0,00,50.0,0.0,M,0.0,M,0.0,0000*72
* 1 2 3 3
* 8 6 0 9
*/
int c;
int n = 0;
int packet_len = 396; /* better check */
char lat[10];
float lat_f;
while(1) {
c = Serial.read();
if(n == packet_len) {
n = 0;
continue;
}
if(n >= 18 && n <= 26) {
lat[n - 18] = c;
if(n == 26) {
lat[9] = 0;
lat_f = float(lat);
}
}
/* and similar for long */
}
hopefully i can workout what to do with it XD