Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: thermistor.h
- Revision:
- 0:59f09202ccbb
diff -r 000000000000 -r 59f09202ccbb thermistor.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/thermistor.h Thu Oct 05 20:02:27 2017 +0000
@@ -0,0 +1,16 @@
+/* thermistor.h
+
+ Contains the definition for the Fahrenheit temperature calculation
+
+ The input is the analog reading, and the returned float value is the
+ temperature in degrees Fahrenheit.
+
+*/
+
+float temp_calc(float analog_value) {
+ double R_ratio = (1/analog_value - 1);
+ double logR_ratio=log(R_ratio);
+ double T_kelvin=1/(.003354016+.000256985*logR_ratio+.000002620131*logR_ratio*logR_ratio);
+ float T = 1.8*(T_kelvin - 273) + 32;
+ return T;
+}
\ No newline at end of file