Darren Ulrich / Mbed 2 deprecated Bicycl_Computer_NUCLEO-L476RG

Dependencies:   BMP180 BNO055_fusion Fonts GPSISR HTU21D SDFileSystem UniGraphic mbed uGUI

Fork of Bicycl_Computer_NUCLEO-F411RE by Darren Ulrich

Files at this revision

API Documentation at this revision

Comitter:
trevieze
Date:
Thu Feb 16 23:56:02 2017 +0000
Parent:
8:8aa9cdab4a07
Child:
10:a3cb458d7b1c
Commit message:
GPS ISR Wrapper Working?

Changed in this revision

GPSISR.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
--- a/GPSISR.lib	Fri Feb 10 17:58:22 2017 +0000
+++ b/GPSISR.lib	Thu Feb 16 23:56:02 2017 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/simon/code/GPS/#4b5ffae743c0
+http://developer.mbed.org/users/simon/code/GPS/#dbc6c0789611
--- a/main.cpp	Fri Feb 10 17:58:22 2017 +0000
+++ b/main.cpp	Thu Feb 16 23:56:02 2017 +0000
@@ -28,7 +28,7 @@
 #include "BMP180.h"
 #include "SDFileSystem.h"
 #include "GPSISR.h"
-#include "nmea.h"
+
 
 #include "Arial12x12.h"
 #include "Arial24x23.h"
@@ -99,9 +99,9 @@
 // SD Card Reader On Adafruit GPS Shield
 SDFileSystem sd(PIN_MOSI_SPI3, PIN_MISO_SPI3, PIN_SCLK_SPI3, PIN_CS_SPI3, "sd"); // the pinout on the mbed Cool Components workshop board
 
-// Adafruit GPS Shield
+// Set up serial interrupe service handler for gps characters.
 GPS MyGPS(PIN_TX_GPS,PIN_RX_GPS, 9600);
-NMEA nmea;
+
 
 int page = 0 ;
 int numPage = 2 ;
@@ -243,11 +243,8 @@
    
 int main()
 {
-    //MyGPS._gps.attach(&MyGPS,&GPS::Rx_interrupt, Serial::RxIrq);
-    //GPS myGPS(PIN_TX_GPS,PIN_RX_GPS);
     Timer refresh_Timer; //sets up a timer for use in loop; how often do we print GPS info?
-    const int refresh_Time = 100; //refresh time in ms
-    
+    const int refresh_Time = 1000; //refresh time in ms
     refresh_Timer.start();  //starts the clock on the timer
     TFT.BusEnable(true) ;
     //backlight = 0 ;
@@ -262,7 +259,16 @@
             //pc.printf("Time: %f\n", myGPS.time);
             //MyGPS.getline();
             //pc.printf("%s", MyGPS.msg[0]);
-            pc.printf("rx_int: %c ", MyGPS.rx_in);
+            pc.printf("rx_int: %c \n", MyGPS.rx_in);
+            
+            if (MyGPS.isdatardy()) {
+                pc.printf("NMEA has valid data");
+                pc.printf("Sats : %d \n", MyGPS.getSats());
+            }
+            else {
+                 pc.printf("NMEA has no valid data");
+            }     
+                
             TFT.set_font((unsigned char*) Arial12x12);
             TFT.foreground(Blue);
             TFT.locate(2, 2);