Russell Shomberg
/
shomberg_hw_6
HW6 for OCE560
Fork of shomberg_hw_5 by
Diff: OCE360Input.cpp
- Revision:
- 11:42914083ac70
- Parent:
- 9:da0b72918880
- Child:
- 12:ea407dcaff78
--- a/OCE360Input.cpp Thu Oct 25 18:37:48 2018 +0000 +++ b/OCE360Input.cpp Thu Oct 25 18:58:41 2018 +0000 @@ -22,6 +22,13 @@ #define TEMP_CALIBRATION_A 0.01 #define TEMP_CALIBRATION_B 0 +DigitalIn myswitch(p7); +AnalogIn Ain(p20); + +int switchPosition; +int sensorVoltage; +int sensorTemp; + int read_switch(void) { return myswitch; } @@ -30,6 +37,6 @@ return Ain*VREF*1000; } -float convert_mV_to_temp(int sensorVoltage) { +float convert_mV_to_temp(float sensorVoltage) { return sensorVoltage*TEMP_CALIBRATION_A+TEMP_CALIBRATION_B; }