if(millis() - _lastTemperatureRead >= _TimeBetweenReadings) { //time to measure temperature
/** measure Vout analog sample */
digitalWrite(_OutputPin_SensorPower, HIGH); // initialize sensor on
digitalWrite(_OutputPin_ThirdLinePower, HIGH); // initialize sensor on
delay(10);
_VoutAnalogSample = analogRead(_InputPin_TemperatureReading) + _sampleDeviation; // Get a reading
_VoutRAnalogSample = analogRead(_InputPin_ThirdLineReading) + _sampleDeviation; // Get a reading
digitalWrite(_OutputPin_SensorPower, LOW); // initialize sensor on
digitalWrite(_OutputPin_ThirdLinePower, LOW); // initialize sensor on
_lastTemperatureRead = millis(); // Mark time of temperature reading
_rTemperatureMeasurementsMarker++; // Position reading buffer marker at the last updated position
if(_rTemperatureMeasurementsMarker >= TEMPERATURE_AVERAGE_VALUE_I) _rTemperatureMeasurementsMarker = 0; // Check that it has not gone out of the buffer range