// Tim Hirzel // March 2008 // All code released under // Creative Commons Attribution-Noncommercial-Share Alike 3.0 // float tcSum = 0.0; float latestReading = 0.0; int readCount = 0; void updateTempSensor() { tcSum += analogRead(TEMP_SENSOR_PIN); //output from AD595 to analog pin 1 readCount +=1; } float getFreshTemp() { latestReading = tcSum*CALIBRATION/readCount; readCount = 0; tcSum = 0.0; return latestReading; } float getLastTemp() { return latestReading; } // END Temperature Sensor