2nd version

Dependencies:   GPS mbed

Files at this revision

API Documentation at this revision

Comitter:
gegjackson
Date:
Tue Mar 01 15:08:54 2016 +0000
Commit message:
b

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 0cfced8c9bac GPS.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GPS.lib	Tue Mar 01 15:08:54 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/GPS/#15611c7938a3
diff -r 000000000000 -r 0cfced8c9bac main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Mar 01 15:08:54 2016 +0000
@@ -0,0 +1,33 @@
+#include "mbed.h"
+#include "GPS.h"
+ /*THIS FILE IS MADE TO RUN ON THE MBED. IT WILL TAKE A GPS VALUE AND WRITE IT
+TO A TEXT FILE*/
+
+Serial pc(USBTX, USBRX);
+GPS gps(p9, p10);
+LocalFileSystem local("local"); // Create the local filesystem called "local"
+DigitalOut myled(LED2); //different led from the accelerometer value so when we combine the code there will be no overlap
+
+int main() {
+      //if(gps.sample()) 
+       // {
+            FILE *fpgps = fopen("/local/gpsvalue.txt", "w"); // Open "gpsvalue.txt"
+            fprintf(fpgps,"I'm at longitude: %f latitude: %f \n", gps.longitude, gps.latitude);
+            //this simply prints the gps values in a text file. we only need to do this once as we are assuming the mbed will stay at the same long and lat while taking data.
+            fclose(fpgps); //save and close the file
+            myled = 1;//two short flashes for a succesfull gps reading
+            wait(0.2);
+            myled = 0;
+            wait(0.2);
+            myled = 1;
+            wait(0.2);
+            myled = 0;
+            wait(0.2);
+            
+        //} else {
+           // myled = 1;//one long flash for a failure to lock on to the gps
+           // wait(0.5);
+          //  myled = 0;
+          //  wait(0.5);
+
+    }
diff -r 000000000000 -r 0cfced8c9bac mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Mar 01 15:08:54 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/252557024ec3
\ No newline at end of file