K64F based data logger for GPS (ublox MAX M8Q) & 6 Axis Sensor (FXOS8700Q) - Outputs to SD + UDP - Uses FRDM K64F + ublox "Cellular and positioning shield" (3G version)

Dependencies:   MAX_M8Q_Capture EthernetInterface FXOS8700Q SDFileSystem eCompass_FPU_Lib mbed-rtos mbed

Revision:
2:bcd60a69583f
Parent:
0:77857a36b4ff
--- a/MAX_M8Q.cpp	Fri Mar 27 08:40:00 2015 +0000
+++ b/MAX_M8Q.cpp	Thu Apr 02 20:09:44 2015 +0000
@@ -1,6 +1,7 @@
 #include "mbed.h"
 #include "MAX_M8Q.h"
 #include "GPS.h"
+#include "debug.h"
 
 //------------------------------------------------------------------------------------
 /* This example was tested on C027-U20 and C027-G35 with the on board modem. 
@@ -34,7 +35,7 @@
     GPSI2C gps;
 
 
-    printf("GPS Loop\r\n");
+    D(printf("GPS Loop\r\n"));
 
 
     bool GGA_done = false;
@@ -68,19 +69,19 @@
                     // Test for GGA NMEA Message
                     if (_CHECK_TALKER("GGA")) {
                         // GGA Message Detected
-                        printf("GGA NMEA Message Detected:%.*s\r\n",len-2, buf);
+                        D(printf("GGA NMEA Message Detected:%.*s\r\n",len-2, buf));
                         
                         // Extract NS (GGA, field 3)
                         if(gps.getNmeaItem(3,buf,len,gpsinfo.NS))
-                            printf("NS: %c\r\n", gpsinfo.NS); 
+                            D(printf("NS: %c\r\n", gpsinfo.NS)); 
                         
                         // Extract EW (GGA, field 5)
                         if(gps.getNmeaItem(5,buf,len,gpsinfo.EW))
-                            printf("EW: %c\r\n", gpsinfo.EW); 
+                            D(printf("EW: %c\r\n", gpsinfo.EW)); 
                         
                         // Extract Altitude (GGA, field 9)
                         if(gps.getNmeaItem(9,buf,len,gpsinfo.alt))
-                            printf("Altitude: %.1f\r\n", gpsinfo.alt); 
+                            D(printf("Altitude: %.1f\r\n", gpsinfo.alt)); 
                         
                         // Set flag indicating GGA processing complete
                         GGA_done = true;  
@@ -90,23 +91,23 @@
                     // Test for RMC NMEA Message
                     if (_CHECK_TALKER("RMC")) {
                         // RMC Message Detected
-                        printf("RMC NMEA Message Detected:%.*s\r\n",len-2, buf);
+                        D(printf("RMC NMEA Message Detected:%.*s\r\n",len-2, buf));
                         
                         // Extract Time (RMC, field 1)
                         if(gps.getNmeaItem(1,buf,len,gpsinfo.utc))
-                            printf("Time: %.2f\r\n", gpsinfo.utc);
+                            D(printf("Time: %.2f\r\n", gpsinfo.utc));
                             
                         // Extract Latitude (RMC, field 3)
                         if(gps.getNmeaAngle(3,buf,len,gpsinfo.lat))
-                            printf("Latitude: %.5f\r\n", gpsinfo.lat);
+                            D(printf("Latitude: %.5f\r\n", gpsinfo.lat));
                             
                         // Extract Longtitude (RMC, field 5)
                         if(gps.getNmeaAngle(5,buf,len,gpsinfo.lng))
-                            printf("Longtitude: %.5f\r\n", gpsinfo.lng);
+                            D(printf("Longtitude: %.5f\r\n", gpsinfo.lng));
                         
                         // Extract Date (RMC, field 9)
                         if(gps.getNmeaItem(9,buf,len,gpsinfo.dte,10))
-                            printf("Date: %d\r\n", gpsinfo.dte);
+                            D(printf("Date: %d\r\n", gpsinfo.dte));
                         
                         // Set flag indicating RMC processing complete
                         RMC_done = true;
@@ -116,11 +117,11 @@
                     // Test for VTG NMEA Message
                     if (_CHECK_TALKER("VTG")) {
                         // VTG Message Detected
-                        printf("VTG NMEA Message Detected:%.*s\r\n",len-2, buf);
+                        D(printf("VTG NMEA Message Detected:%.*s\r\n",len-2, buf));
                         
                         // Extract Speed_kmph (VTG, field 7)
                         if(gps.getNmeaItem(7,buf,len,gpsinfo.spd))
-                            printf("Speed: %.3f\r\n", gpsinfo.spd);
+                            D(printf("Speed: %.3f\r\n", gpsinfo.spd));
                         
                         // Set flag indicating VTG processing complete
                         VTG_done = true;
@@ -132,7 +133,7 @@
     } // restart while loop
    
     // All GPS Data has been collected, power off receiver
-    printf("GPS Data Collected\r\n");
+    D(printf("GPS Data Collected\r\n"));
     
     return(0);
 }