Calculate temperature based on resistance from thermistor with lookup chart

Revision:
5:88bf5a42812e
Parent:
0:39f659087759
Child:
6:3c9cb2bd08c6
--- a/thermister_ert-j0eg1.h	Thu Mar 10 22:15:04 2016 +0000
+++ b/thermister_ert-j0eg1.h	Wed Mar 30 13:32:40 2016 +0000
@@ -1,8 +1,26 @@
 #ifndef thermister_ert_j0eg1_h
 #define thermister_ert_j0eg1_h
+#define ERTThermisterAdcRef  3.30f
+#define ERTThermisterErrorOver 255.0f 
+#define ERTThermisterErrorUnder -255.0f
 
 float conv_c_to_f(float tempC);
-float readTemp(AnalogIn adcpin);
-float avgReadTemp(AnalogIn adcpin, int numRead);
+float conv_f_to_c(float tempF);
+float ERTThermisterReadTemp(AnalogIn adcpin);
+float ERTThermisterAvgReadTemp(AnalogIn adcpin, int numRead);
+
+
+// Read the ERT0xxx thermister and return the temperature
+// in C on the specified pin. 
+// TODO:  How do we detect and report error of -999;
+
+// Shorthand to read thermister by pinName
+// rather than reading it with pre-allocated
+// AnalogIn.  
+float ERTThermisterRead(PinName apin);
+
+// read the temp from thermister and print out
+// both the reading and intermediate values.
+float ERTThermisterReadPrint(Serial log, char *label, PinName apin);
 
 #endif