program for final combination of working pieces
Dependencies: SDFileSystem TMP102 mbed ISL29125
Fork of TEMP_Test by
TEMPSensor.cpp@8:28f8162d2929, 2016-03-31 (annotated)
- Committer:
- tdale19
- Date:
- Thu Mar 31 17:53:11 2016 +0000
- Revision:
- 8:28f8162d2929
- Parent:
- 7:6becc29457ce
- Child:
- 13:906a647d7bd1
Program now works for UV as well
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tdale19 | 4:4b67d7667474 | 1 | #include "mbed.h" |
Jeriah | 0:547856de255b | 2 | // The location of the sensor on the FRDM-K64F// |
Jeriah | 0:547856de255b | 3 | |
tdale19 | 7:6becc29457ce | 4 | AnalogIn thermometerInside(PTC10); |
tdale19 | 4:4b67d7667474 | 5 | AnalogIn thermometerOutside1(PTB3); |
tdale19 | 4:4b67d7667474 | 6 | AnalogIn thermometerOutside2(PTC11); |
tdale19 | 7:6becc29457ce | 7 | AnalogIn thermometerPanel(PTB10); |
Jeriah | 0:547856de255b | 8 | |
tdale19 | 4:4b67d7667474 | 9 | float get_outsideTemp()//function to return temperature readings from outside thermometers not in contact with the panels |
tdale19 | 4:4b67d7667474 | 10 | { |
tdale19 | 7:6becc29457ce | 11 | float readOne = thermometerOutside1.read(); |
tdale19 | 7:6becc29457ce | 12 | float readTwo = thermometerOutside2.read(); |
tdale19 | 7:6becc29457ce | 13 | float outsideTemp = ( readTwo + readOne ) / 2; //average of two outside thermometer |
tdale19 | 7:6becc29457ce | 14 | return ( outsideTemp * 100 ); //conversion to celcius |
Jeriah | 0:547856de255b | 15 | } |
tdale19 | 4:4b67d7667474 | 16 | |
tdale19 | 7:6becc29457ce | 17 | float get_insideTemp()//function to return data from inside thermometer |
tdale19 | 4:4b67d7667474 | 18 | { |
tdale19 | 4:4b67d7667474 | 19 | float insideTemp = thermometerInside.read(); // onboard in-pod thermometer |
tdale19 | 7:6becc29457ce | 20 | return ( insideTemp * 100 ) ; //conversion to celcius |
tdale19 | 4:4b67d7667474 | 21 | } |
tdale19 | 4:4b67d7667474 | 22 | |
tdale19 | 7:6becc29457ce | 23 | float get_panelTemp()//function to return data from the thermometer in contact with the solar panels |
tdale19 | 4:4b67d7667474 | 24 | { |
tdale19 | 7:6becc29457ce | 25 | float panelTemp = thermometerPanel.read(); // on-panel thermometer |
tdale19 | 7:6becc29457ce | 26 | return ( panelTemp *100 ); // conversion to celcius |
tdale19 | 4:4b67d7667474 | 27 | } |