4180 weather balloon logging and cutdown system

Dependencies:   GPS MPL3115A2 SDFileSystem mbed-rtos mbed

Fork of WeatherBalloon4180 by Chad Miller

Files at this revision

API Documentation at this revision

Comitter:
Gjika
Date:
Mon Dec 07 19:02:21 2015 +0000
Parent:
5:c3e1fc7fa00d
Commit message:
Final version of 4180 weather balloon

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Dec 01 20:38:27 2015 +0000
+++ b/main.cpp	Mon Dec 07 19:02:21 2015 +0000
@@ -45,6 +45,7 @@
 bool attempted = false, cutdown = false, gps_locked = false;
 bool log_open = log_switch;
 float tempF1, tempF2, tempF3;
+float analog1, analog2;
 
 FILE *sdout;
 Timer t;
@@ -82,16 +83,14 @@
 
 void update_temperature(void const *args)
 {
-    float tempC1, tempC2, tempC3;
+    float tempC1;
     
     while(true)
     {
         tempC1 = ((temp1 * 3.3) - 0.600) * 100.0;
-        tempC2 = ((temp2 * 3.3) - 0.600) * 100.0;
-        tempC3 = ((temp3 * 3.3) - 0.600) * 100.0;
         tempF1 = (9.0 * tempC1) / 5.0 + 32;
-        tempF2 = (9.0 * tempC2) / 5.0 + 32;
-        tempF3 = (9.0 * tempC3) / 5.0 + 32;
+        analog1 = (temp2);
+        analog2 = (temp3);
         
         Thread::wait(250);
     }
@@ -133,9 +132,9 @@
             
             fprintf(sdout, "----- %f -----\r\n", t.read());
             fprintf(sdout, "Long = %f\r\nLati = %f\r\n", gps.longitude, gps.latitude);
-            fprintf(sdout, "Temp1 = %f\r\nTemp2 = %f\r\nTemp3 = %f\r\n", -tempF1, -tempF2, -tempF3);
+            fprintf(sdout, "Temp1 = %f\r\nAnalog1 = %f\r\nAnalog2 = %f\r\n", tempF1, analog1, analog2);
             fprintf(sdout, "Altitude = %s ft, offset = 0x%X\r\n", alt_altitude.print(), altimeter.offsetAltitude());
-            fprintf(sdout, "Temperature = %s deg F, offset = 0x%X\r\n", alt_temperature.print(), altimeter.offsetTemperature());
+            //fprintf(sdout, "Temperature = %s deg F, offset = 0x%X\r\n", alt_temperature.print(), altimeter.offsetTemperature());
             //fprintf(sdout, "Pressure = %s Pa, offset = 0x%X\r\n", alt_pressure.print(), altimeter.offsetPressure());
             fprintf(sdout, dtmf1 ? "DTMF 1 = True\r\n" : "DTMF 1 = False\r\n");
             fprintf(sdout, dtmf2 ? "DTMF 2 = True\r\n" : "DTMF 2 = False\r\n");
@@ -144,9 +143,9 @@
             #ifdef PC_DEBUG
             pc.printf("----- %f -----\r\n", t.read());
             pc.printf("Long = %f\r\nLati = %f\r\n", gps.longitude, gps.latitude);
-            pc.printf("Temp1 = %f\r\nTemp2 = %f\r\nTemp3 = %f\r\n", -tempF1, -tempF2, -tempF3);
+            pc.printf("Temp1 = %f\r\nAnalog1 = %f\r\nAnalog2 = %f\r\n", tempF1, analog1, analog2);
             pc.printf("Altitude = %s ft, offset = 0x%X\r\n", alt_altitude.print(), altimeter.offsetAltitude());
-            pc.printf("Temperature = %s deg F, offset = 0x%X\r\n", alt_temperature.print(), altimeter.offsetTemperature());
+            //pc.printf("Temperature = %s deg F, offset = 0x%X\r\n", alt_temperature.print(), altimeter.offsetTemperature());
             //pc.printf("Pressure = %s Pa, offset = 0x%X\r\n", alt_pressure.print(), altimeter.offsetPressure());
             pc.printf(dtmf1 ? "DTMF 1 = True\r\n" : "DTMF 1 = False\r\n");
             pc.printf(dtmf2 ? "DTMF 2 = True\r\n" : "DTMF 2 = False\r\n");