/*

  thermistor.h - Library for measuring temperature with thermistors
  Created by Craig Wm. Versek, 2012-08-12
  Released into the public domain.
 */

  1. ifndef _THERMISTOR_H_INCLUDED
  2. define _THERMISTOR_H_INCLUDED
  3. define MAX_10BIT 1023
  4. define VOLTAGE_REF 5.0 /* volts */
  5. define T_ABS -273.15 /* degrees Celsius */

class Thermistor{ public:

    Thermistor(double A, double B, double C, double R_25C, double R_std);
    void begin(int analogSensePin );
    double readVoltage();
    double readResistance();    
    double readTemperature();

private:

    double _A;
    double _B;
    double _C;
    double _R_25C;
    double _R_std;
    int _analogSensePin;

};

  1. endif //_THERMISTOR_H_INCLUDED

Share