A basic library for the Adafruit Ultimate GPS module. (MTK3339) http://www.adafruit.com/products/746
Fork of GPS by
Diff: GPS.cpp
- Revision:
- 2:dcc14e81f8be
- Parent:
- 1:0a034c2dbea6
- Child:
- 3:5cb504ce2793
diff -r 0a034c2dbea6 -r dcc14e81f8be GPS.cpp --- a/GPS.cpp Tue Oct 09 18:47:58 2012 +0000 +++ b/GPS.cpp Sat Oct 13 04:27:18 2012 +0000 @@ -11,7 +11,7 @@ while(1) { getData(); if(sscanf(NEMA, "GPGGA, %*f, %*f, %*c, %*f, %*c, %d, %d, %*f, %f", &fixtype, &satellites, &altitude) >=1); - if(sscanf(NEMA, "GPRMC, %f, %c, %f, %c, %f, %c, %f, %f, %d", &time, &validity, &latitude, &ns, &longitude, &ew, &speed, &heading, &date) >=1) { + if(sscanf(NEMA, "GPRMC, %2d%2d%f, %c, %f, %c, %f, %c, %f, %f, %d", &hours, &minutes, &seconds, &validity, &latitude, &ns, &longitude, &ew, &speed, &heading, &date) >=1) { if(fixtype == 0) { return 0; } @@ -60,7 +60,7 @@ void GPS::Init() { - _UltimateGps.printf("$PMTK220,1000*1F\r\n"); + _UltimateGps.printf("$PMTK220,200*2C\r\n"); wait(1); _UltimateGps.printf("$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n"); wait(1);