Implement a SD card into HW6
Dependencies: SDFileSystem mbed
Fork of shomberg_hw_6 by
Diff: OCE360Input.cpp
- Revision:
- 13:fa74bf0c3b8d
- Parent:
- 12:ea407dcaff78
- Child:
- 20:fc1690076f87
diff -r ea407dcaff78 -r fa74bf0c3b8d OCE360Input.cpp --- a/OCE360Input.cpp Thu Oct 25 22:43:36 2018 +0000 +++ b/OCE360Input.cpp Tue Oct 30 14:08:21 2018 +0000 @@ -22,7 +22,8 @@ #define TEMP_CALIBRATION_A 0.1 #define TEMP_CALIBRATION_B 0 - +DigitalIn myswitch(p7); +AnalogIn Ain(p20); int switchPosition; int sensorVoltage; @@ -33,9 +34,9 @@ } float read_sensor(void){ - return Ain*VREF*1000; + return Ain*VREF*1000; // voltage in mV } float convert_mV_to_temp(float sensorVoltage) { - return sensorVoltage*TEMP_CALIBRATION_A+TEMP_CALIBRATION_B; + return sensorVoltage*TEMP_CALIBRATION_A+TEMP_CALIBRATION_B; //temp in deg C }