Demo to get GPS data.

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
uBerry
Date:
Wed Jul 13 16:29:59 2016 +0000
Commit message:
commit

Changed in this revision

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 e80d81207d7a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jul 13 16:29:59 2016 +0000
@@ -0,0 +1,54 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX);
+Serial gps(PTC15, PTC14);  // UART4
+
+DigitalOut RESET(PTC9);
+DigitalOut WAKEUP(PTC7);
+DigitalOut POWER(PTC8);
+ 
+void setupGPS()
+{
+    RESET = 1;
+    wait_ms(300);        
+    RESET = 0;
+    
+    // WAKEUP signal will be issued whe ON_OFF signal goes high
+    WAKEUP = 0;
+    wait_ms(100);             
+    WAKEUP = 1;
+    wait(2.0f);
+    WAKEUP = 0;
+    wait_ms(100);
+    
+    POWER = 1;
+    wait_ms(200);
+    POWER = 0;
+    
+    gps.baud(4800);
+}
+
+char dataRaw[100];
+short nmeaReady;
+int count;
+
+int main()
+{        
+    pc.printf("Hello uBerry\r\n");
+    
+    setupGPS();
+
+    while (1) 
+    { 
+        if(gps.readable())
+        {                            
+            //pc.putc(gps.getc());            
+            count = 0;
+            dataRaw[count] = gps.getc();                            
+            count++;          
+            pc.printf((char*)dataRaw);  
+        } else {
+            
+        }
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r e80d81207d7a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jul 13 16:29:59 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34
\ No newline at end of file