The official code that runs on the FRDM board for the chlorine sensor.

Dependencies:   MBed_Adafruit-GPS-Library SDFileSystem mbed GSM_Library

Fork of DCS by Brandon Crofts

Revision:
5:f0946f8ed23a
Parent:
4:35d92f290cfe
Child:
7:1c38181cb11f
--- a/Sensor.cpp	Sat Mar 07 23:34:49 2015 +0000
+++ b/Sensor.cpp	Sat Mar 07 23:57:06 2015 +0000
@@ -10,6 +10,7 @@
 DigitalOut led_red(LED_RED);
 Serial pc(USBTX, USBRX);
 Serial gsm(PTC17,PTC16);
+
 Timer t;
 
 /**************************************************
@@ -83,18 +84,19 @@
     
     pc.baud(115200);
     gsm.baud(115200);
+    
     pc.printf("hello\r\n");
     
     //GSM INITIALIZATION ///////////////////////////////
     gsm_initialize();
     // GPS INITIALIZATION //////////////////////////////
-    //gps_Serial = new Serial(D1,D0);
-    //Adafruit_GPS myGPS(gps_Serial);
-    //char c;
-    //myGPS.begin(9600);
-    //myGPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
-    //myGPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);
-    //myGPS.sendCommand(PGCMD_ANTENNA);
+    Adafruit_GPS myGPS(gps_Serial);
+    gps_Serial = new Serial(PTD3,PTD2); 
+    myGPS.begin(9600);
+    volatile char c;
+    myGPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
+    myGPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);
+    myGPS.sendCommand(PGCMD_ANTENNA);
     ////////////////////////////////////////////////////
     
     buildIQ();
@@ -153,7 +155,7 @@
             filteredShort = QAM(sSI, sSQ, &pc);
             filteredShortRef = QAM(sRefSI, sRefSQ, &pc);
         }  
-        
+       
         c = myGPS.read();
         if ( myGPS.newNMEAreceived() ) {
             if ( !myGPS.parse(myGPS.lastNMEA()) ) {
@@ -197,7 +199,7 @@
         
         
         
-        /*
+        
         if (sampleIndex+2 > SAMPLE_LENGTH) { // 0.25 seconds
             
             sampleIndex = 0;
@@ -221,6 +223,6 @@
                 fclose(fp);
             }    
         }
-        */
+        
     }
 }
\ No newline at end of file