Joseph Ellsworth / temp-thermisterfor-ERT-J0
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers thermister_ert-j0eg1.h Source File

thermister_ert-j0eg1.h

00001 /* thermister_ert-j0eg1.h
00002    Read the ERT0xxx thermister and return the temperature
00003    in C on the specified pin.   Includes lookup table to 
00004    compute precision temperature based on non-linear 
00005    change of resistance in thermister.   
00006    
00007    Update the resitance array in cpp to properly reflect
00008    your specific device. 
00009 
00010   By Joseph Ellsworth CTO of A2WH
00011   Take a look at A2WH.com Producing Water from Air using Solar Energy
00012   March-2016 License: https://developer.mbed.org/handbook/MIT-Licence 
00013 */
00014 #ifndef thermister_ert_j0eg1_h
00015 #define thermister_ert_j0eg1_h
00016 #define ERTThermisterAdcRef  3.30f
00017 #define ERTThermisterErrorOver 255.0f 
00018 #define ERTThermisterErrorUnder -255.0f
00019 
00020 float conv_c_to_f(float tempC);
00021 float conv_f_to_c(float tempF);
00022 float ERTThermisterReadTemp(AnalogIn adcpin);
00023 float ERTThermisterAvgReadTemp(AnalogIn adcpin, int numRead);
00024 
00025 
00026 
00027 // Shorthand to read thermister by pinName
00028 // rather than reading it with pre-allocated
00029 // AnalogIn.  
00030 float ERTThermisterRead(PinName apin);
00031 
00032 // read the temp from thermister and print out
00033 // both the reading and intermediate values.
00034 float ERTThermisterReadPrint(Serial log, char *label, PinName apin);
00035 
00036 #endif