calibration started
This commit is contained in:
@ -27,12 +27,12 @@ void Thermometer::begin(bool initializeConfig, int eepromAddr) {
|
||||
|
||||
|
||||
void Thermometer::exec(float r) {
|
||||
temperatureRaw = (r / PT1000_R0 - 1) / PT1000_Coeff;
|
||||
m_temperatureRaw = (r / PT1000_R0 - 1) / PT1000_Coeff;
|
||||
|
||||
if (m_lastSmoothedTemperature == INVALID_TEMPERATURE) {
|
||||
temperature = temperatureRaw;
|
||||
m_temperature = m_temperatureRaw;
|
||||
} else {
|
||||
temperature = alpha * temperatureRaw + (1.0 - alpha) * m_lastSmoothedTemperature;
|
||||
m_temperature = m_alpha * m_temperatureRaw + (1.0 - m_alpha) * m_lastSmoothedTemperature;
|
||||
}
|
||||
m_lastSmoothedTemperature = temperature;
|
||||
}
|
||||
|
Reference in New Issue
Block a user