Example to go with my modified GPS library

Dependencies:   GPS mbed

Fork of GPS_HelloWorld by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
8fromPi
Date:
Sat Nov 02 16:27:23 2013 +0000
Parent:
0:6b7345059afe
Commit message:
Example to go with GPS library

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
--- a/GPS.lib	Tue Jun 08 14:12:30 2010 +0000
+++ b/GPS.lib	Sat Nov 02 16:27:23 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/simon/code/GPS/#15611c7938a3
+http://mbed.org/users/8fromPi/code/GPS/#1d60e6a0ffd9
--- a/main.cpp	Tue Jun 08 14:12:30 2010 +0000
+++ b/main.cpp	Sat Nov 02 16:27:23 2013 +0000
@@ -1,15 +1,24 @@
+/* Example showing how to hook up to different GPS modules (GlobalSat EM406a and Adafruit Ultimate GPSv3)
+*  to emulated serial ports at different speeds */
 #include "mbed.h"
 #include "GPS.h"
 
+GPS gpsSpark(P0_4, P0_0, 4800);
+GPS gpsAda(P0_12, P0_15, 9600);
+
 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");
+    while (1) {  
+      
+       if(gpsSpark.sample()) {
+          pc.printf("set %d\t%c\t%f\t%f\t%f\t%f\t%f\n\r", takes, 'Sparkfun Breakout', gpsSpark.longitude, gpsSpark.latitude, gpsSpark.alt, gpsSpark.geoid, gpsSpark.time);
+       }
+  
+       if(gpsAda.sample()) {
+          pc.printf("set %d\t%c\t%f\t%f\t%f\t%f\t%f\n\r", takes, 'Adafruit', gpsAda.longitude, gpsAda.latitude, gpsAda.alt, gpsAda.geoid, gpsAda.time);
         }
+        
     }
-}
+    
+}
\ No newline at end of file
--- a/mbed.bld	Tue Jun 08 14:12:30 2010 +0000
+++ b/mbed.bld	Sat Nov 02 16:27:23 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/029aa53d7323
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file