35 lines
728 B
C++
35 lines
728 B
C++
#ifndef _THERMOMETER_H_
|
|
#define _THERMOMETER_H_
|
|
|
|
#include <Arduino.h>
|
|
#include <stdint.h>
|
|
|
|
namespace nsThermometer {
|
|
const float R_REF = 3000.0;
|
|
const float PT1000_R0 = 1000.0;
|
|
const float PT1000_Coeff = 3.85e-3;
|
|
};
|
|
|
|
class Thermometer {
|
|
public:
|
|
Thermometer();
|
|
void begin(bool initializeConfig, int eepromAddr);
|
|
void exec(float r);
|
|
|
|
float getAlpha() const { return m_alpha; };
|
|
void setAlpha(float alpha);
|
|
|
|
float getTemperature() const { return m_temperature; };
|
|
float getTemperatureRaw() const { return m_temperatureRaw; };
|
|
private:
|
|
int m_eepromAddr;
|
|
float m_lastSmoothedTemperature;
|
|
float m_smoothedTemperature;
|
|
|
|
float m_alpha;
|
|
float m_temperature;
|
|
float m_temperatureRaw;
|
|
};
|
|
|
|
#endif // _THERMOMETER_H_
|