program for final combination of working pieces

Dependencies:   SDFileSystem TMP102 mbed ISL29125

Fork of TEMP_Test by Thomas Dale

Committer:
tdale19
Date:
Thu Mar 31 17:32:01 2016 +0000
Revision:
7:6becc29457ce
Parent:
4:4b67d7667474
Child:
8:28f8162d2929
Final Project. With working thermometers and working Solar Panels

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tdale19 4:4b67d7667474 1 #include "TEMPSensor.h"
tdale19 4:4b67d7667474 2 #include "mbed.h"
Jeriah 0:547856de255b 3 // The location of the sensor on the FRDM-K64F//
Jeriah 0:547856de255b 4
tdale19 7:6becc29457ce 5 AnalogIn thermometerInside(PTC10);
tdale19 4:4b67d7667474 6 AnalogIn thermometerOutside1(PTB3);
tdale19 4:4b67d7667474 7 AnalogIn thermometerOutside2(PTC11);
tdale19 7:6becc29457ce 8 AnalogIn thermometerPanel(PTB10);
Jeriah 0:547856de255b 9
tdale19 4:4b67d7667474 10 float get_outsideTemp()//function to return temperature readings from outside thermometers not in contact with the panels
tdale19 4:4b67d7667474 11 {
tdale19 7:6becc29457ce 12 float readOne = thermometerOutside1.read();
tdale19 7:6becc29457ce 13 float readTwo = thermometerOutside2.read();
tdale19 7:6becc29457ce 14 float outsideTemp = ( readTwo + readOne ) / 2; //average of two outside thermometer
tdale19 7:6becc29457ce 15 return ( outsideTemp * 100 ); //conversion to celcius
Jeriah 0:547856de255b 16 }
tdale19 4:4b67d7667474 17
tdale19 7:6becc29457ce 18 float get_insideTemp()//function to return data from inside thermometer
tdale19 4:4b67d7667474 19 {
tdale19 4:4b67d7667474 20 float insideTemp = thermometerInside.read(); // onboard in-pod thermometer
tdale19 7:6becc29457ce 21 return ( insideTemp * 100 ) ; //conversion to celcius
tdale19 4:4b67d7667474 22 }
tdale19 4:4b67d7667474 23
tdale19 7:6becc29457ce 24 float get_panelTemp()//function to return data from the thermometer in contact with the solar panels
tdale19 4:4b67d7667474 25 {
tdale19 7:6becc29457ce 26 float panelTemp = thermometerPanel.read(); // on-panel thermometer
tdale19 7:6becc29457ce 27 return ( panelTemp *100 ); // conversion to celcius
tdale19 4:4b67d7667474 28 }