Wesley Schon / Mbed 2 deprecated GPS_HelloWorld

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
wschon
Date:
Sat Mar 12 19:48:59 2016 +0000
Commit message:
1st commit

Changed in this revision

GPS.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GPS.lib	Sat Mar 12 19:48:59 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/wschon/code/GPS_HelloWorld/#e4c8d53dc4f3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Mar 12 19:48:59 2016 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+#include "GPS.h"
+
+Serial pc(USBTX, USBRX);
+GPS gps(p13, p14);
+
+int main() {
+    pc.printf("start main\r\n");
+    while(1) {
+        //wait(0.1);
+        //pc.printf("\nHello world\n\r");
+        //printf ("\n\r the value of GPS sample is : %d\n\r", gps.sample());
+        if(gps.sample()) {
+            pc.printf("I'm at %f, %f\n\r", gps.longitude, gps.latitude);
+            //pc.printf("good\r\n");
+        } else {
+            pc.printf("Oh Dear! No lock :(\n\r");
+            //pc.printf("bad\r\n");
+        }
+    }
+}
+
+
+/*
+$GPRMC,000115.039,V,,,,,,,291006,,*2C
+$GPGGA,000116.031,,,,,0,00,,,M,0.0,M,,0000*52
+$GPGSA,A,1,,,,,,,,,,,,,,,*1E
+$GPGSV,3,1,12,20,00,000,,10,00,000,,31,00,000,,27,00,000,*7C
+$GPGSV,3,2,12,19,00,000,,07,00,000,,04,00,000,,24,00,000,*76
+$GPGSV,3,3,12,16,00,000,,28,00,000,,26,00,000,,29,00,000,*78
+$GPRMC,000116.031,V,,,,,,,291006,,*27
+$GPGGA,000117.035,,,,,0,00,,,M,0.0,M,,0000*57
+$GPGSA,A,1,,,,,,,,,,,,,,,*1E
+$GPRMC,000117.035,V,,,,,,,291006,,*22
+$GPGGA,000118.039,,,,,0,00,,,M,0.0,M,,0000*54
+$GPGSA,A,1,,,,,,,,,,,,,,,*1E
+$GPRMC,000118.039,V,,,,,,,291006,,*21
+$GPGGA,000119.035,,,,,0,00,,,M,0.0,M,,0000*59
+$GPGSA,A,1,,,,,,,,,,,,,,,*1E
+$GPRMC,000119.035,V,,,,,,,291006,,*2C
+$GPGGA,000120.037,,,,,0,00,,,M,0.0,M,,0000*51
+$GPGSA,A,1,,,,,,,,,,,,,,,*1E
+$GPRMC,000120.037,V,,,,,,,291006,,*24
+*/
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Mar 12 19:48:59 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8ed44a420e5c
\ No newline at end of file