GPS library
Revision 9:a6214cf7f73b, committed 2020-04-21
- Comitter:
- memig3
- Date:
- Tue Apr 21 22:52:08 2020 +0000
- Parent:
- 8:720966cb4824
- Commit message:
- GPS library;
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 Thu Mar 17 19:26:14 2016 +0000 +++ b/GPS.cpp Tue Apr 21 22:52:08 2020 +0000 @@ -35,6 +35,12 @@ } +bool GPS::connected() { + + return _gps.readable(); + + } + int GPS::sample() { //float time, hori_dilute, alt,geoid; @@ -45,7 +51,7 @@ // Check if it is a GPGGA msg (matches both locked and non-locked msg) //pc1.printf(msg); //pc1.printf("\n"); - wait(5); + //wait(5); //pc1.printf("display msg\r\n"); //pc1.printf(msg); //pc1.printf("\n"); @@ -141,7 +147,7 @@ for (n = 5; n < 456; n++) { msg[n] = _gps.getc(); - pc1.printf("%c", msg[n]); + //pc1.printf("%c", msg[n]); if(msg[n] == '\r') { msg[n] = '0'; return;
--- a/GPS.h Thu Mar 17 19:26:14 2016 +0000 +++ b/GPS.h Tue Apr 21 22:52:08 2020 +0000 @@ -33,6 +33,7 @@ */ GPS(PinName tx, PinName rx); + bool connected(); /** Sample the incoming GPS data, returning whether there is a lock * * @return 1 if there was a lock when the sample was taken (and therefore .longitude and .latitude are valid), else 0