Test temperature for the near space lab

Dependencies:   SDFileSystem mbed TEMP_Test

Dependents:   TEMP_Test

Fork of RGB_Test by Jeriah Bankson

Revision:
4:4b67d7667474
Parent:
1:e0fc716e2394
Child:
7:b8647f72947c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TEMPSensor.cpp	Wed Mar 16 21:56:06 2016 +0000
@@ -0,0 +1,29 @@
+#include "TEMPSensor.h"
+#include "mbed.h"
+#include "TMP102.h"
+// The location of the sensor on the FRDM-K64F//
+
+I2C i2c(PTE25,PTE24);
+TMP102 thermometerInside(i2c,0x90);
+AnalogIn thermometerOutside1(PTB3);
+AnalogIn thermometerOutside2(PTC11);
+AnalogIn thermometerPanel1(PTB10);
+AnalogIn thermometerPanel2(PTC10);
+
+float get_outsideTemp()//function to return temperature readings from outside thermometers not in contact with the panels
+{
+    float outsideTemp = (thermometerOutside1.read()+ thermometerOutside2.read()) / 2; //average of two outside thermometer
+    return outsideTemp;
+}
+
+float get_insideTemp()//function to return data from inside on-boatd thermometer
+{
+    float insideTemp = thermometerInside.read(); // onboard in-pod thermometer
+    return insideTemp;
+ }       
+
+float get_panelTemp()//function to return data from the thermometers in contact with the solar panels
+{   
+    float panelTemp = (thermometerPanel1.read() + thermometerPanel2.read()) / 2; // average of two on-panel thermometer
+    return panelTemp;
+}
\ No newline at end of file