C027_C20_U20_G35 revB with SARA-G350 GPS library.
Dependencies: GPS_C027_C20_U20_G35_revB_SARA_G350 mbed
Fork of C027_HelloWorld by
Revision 6:7f0ed1d69dc1, committed 2014-02-22
- Comitter:
- timrock
- Date:
- Sat Feb 22 13:28:33 2014 +0000
- Parent:
- 5:41b123533b79
- Commit message:
- Add a sample program to show how to use the library
Changed in this revision
diff -r 41b123533b79 -r 7f0ed1d69dc1 C027.lib --- a/C027.lib Fri Dec 06 09:58:29 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/teams/ublox/code/C027/#e30f90b5447e
diff -r 41b123533b79 -r 7f0ed1d69dc1 GPS.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GPS.lib Sat Feb 22 13:28:33 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/timrock/code/GPS_C027_C20_U20_G35_revB_SARA_G350/#36c3411086a2
diff -r 41b123533b79 -r 7f0ed1d69dc1 main.cpp --- a/main.cpp Fri Dec 06 09:58:29 2013 +0000 +++ b/main.cpp Sat Feb 22 13:28:33 2014 +0000 @@ -1,17 +1,29 @@ #include "mbed.h" -#include "C027.h" - -#ifdef C027_REVA - // on rev A we reasign the signal to A0 - #undef LED - #define LED A0 -#endif - -DigitalOut myled(LED); +#include "GPS.h" + +Serial pc(USBTX, USBRX); +GPS gps(P0_10, P0_11, 9600); int main() { - while(1) { - myled = !myled; - wait(0.2); - } + pc.baud(9600); + + while (1) { + wait(3); + pc.printf("hello, a test \n"); + gps.sample(); + pc.printf("GPS Sats number is %d \n", gps.sats); + + if (gps.ns == 'S') + pc.printf("GPS Latitude = %.4f South; ", gps.latitude * -1.0); + else if (gps.ns == 'N') + pc.printf("GPS Latitude = %.4f North; ", gps.latitude); + if (gps.ew == 'W') + pc.printf("Longitude = %.4f West; ", gps.longitude * - 1.0); + else if (gps.ew == 'E') + pc.printf("Longitude = %.4f East; ", gps.longitude); + pc.printf("Alt = %.4f ", gps.alt); + + } + + }