FRDM-K64F+NEO-6M-GPS Serial GPS Add Beijing time format

Dependencies:   NEO-6m-GPS mbed

Files at this revision

API Documentation at this revision

Comitter:
sampleCode
Date:
Fri Aug 12 08:16:18 2016 +0000
Commit message:
gps;

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
diff -r 000000000000 -r 52831af60170 GPS.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GPS.lib	Fri Aug 12 08:16:18 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/sampleCode/code/NEO-6m-GPS/#7350eda5fa8c
diff -r 000000000000 -r 52831af60170 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Aug 12 08:16:18 2016 +0000
@@ -0,0 +1,18 @@
+/* Example showing how to hook up to different GPS modules (GlobalSat neo-6m)*/
+#include "mbed.h"
+#include "GPS.h"
+//create usb serial
+Serial pc(USBTX, USBRX);
+//creat gps serial baud is 9600
+GPS gpsAda(PTC15, PTC14, 9600);
+
+int main()
+{
+    while (1) {
+        if(gpsAda.sample()){
+          pc.printf("%f\t%c\t%f\t%c\t%f\t%f\t%f\n\r",gpsAda.longitude, gpsAda.ns,gpsAda.latitude,gpsAda.ew, gpsAda.alt, gpsAda.geoid, gpsAda.time);
+          pc.printf("%d:%d:%d",gpsAda.hour,gpsAda.minute,gpsAda.seconed);
+        }
+  }
+
+}
\ No newline at end of file
diff -r 000000000000 -r 52831af60170 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Aug 12 08:16:18 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/f9eeca106725
\ No newline at end of file