Arduino due temperature reading shows random temperatures
Did you read about this smt160 sensor ? It relies on the calculation of duty cycle of the square wave output from the sensor, to calculate the temparature.


  temperature = (dutyCycle) -0.32)/0.0047


The square wave output has to be sampled at 8KHz or at 125us for no loss of information. This block samples that data.


  if (now - lastSample > 50) {
  
  sampleSize++;
  
  highCount1 = highCount1 + digitalRead(sensorPin1);
  
  highCount2 = highCount2 + digitalRead(sensorPin2);
  
  highCount3 = highCount3 + digitalRead(sensorPin3);
  
  lastSample = now;
      }  
  
  else {
          delayMicroseconds(10);
      }


when you increased the number of code lines , information loss also increased, cz more number of instructions have to be executed now , till reaching the corresponding digital reads.