gps nmea sample program

Dependencies:   mbed

Fork of GPS by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
superphil06
Date:
Tue Feb 14 07:35:23 2017 +0000
Parent:
0:15611c7938a3
Child:
2:a0bbb2cf21c2
Commit message:
gps nmea sample progam

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Feb 14 07:35:23 2017 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+#include "GPS.h"
+ 
+Serial pc(USBTX, USBRX);
+GPS gps(p9, p10);
+ 
+int main() {
+    while(1) {
+        if(gps.sample()) {
+            pc.printf("I'm at %f, %f\n", gps.longitude, gps.latitude);
+        } else {
+            pc.printf("Oh Dear! No lock :(\n");
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.lib	Tue Feb 14 07:35:23 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/gokmenascioglu/code/mbed/#a8fa94490a0a