Updated version with new commands and sleep mode
Fork of GPS by
Revision 2:dcc14e81f8be, committed 2012-10-13
- Comitter:
- SamClarke
- Date:
- Sat Oct 13 04:27:18 2012 +0000
- Parent:
- 1:0a034c2dbea6
- Child:
- 3:5cb504ce2793
- Commit message:
- Format for time from hhmmss.msms to hh:mm:ss.msms; gps.hours; gps.minutes; gps.seconds;
Changed in this revision
GPS.cpp | Show annotated file Show diff for this revision Revisions of this file |
GPS.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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);
--- a/GPS.h Tue Oct 09 18:47:58 2012 +0000 +++ b/GPS.h Sat Oct 13 04:27:18 2012 +0000 @@ -29,6 +29,9 @@ void Init(); int parseData(); float time; // UTC time + int hours; + int minutes; + float seconds; char validity,ns,ew;// RMC data status A = Data Valid; V = Data Not valid; float latitude; // float longitude; //