 #include <stdio.h>
 #include <softwareserial.h>
+#include <math.h>
 
 const int ping_sensor_pin = 7;
+const int thermistor_pin = 5;
 const int serial_speed = 9600;
 const int poll_interval = 10000;
+const float vcc = 4.14; // only used for display purposes, if used
+                        // set to the measured Vcc.
+const float pad = 9850; // balance/pad resistor value, set this to
+                        // the measured resistance of your pad resistor
+const float thermr = 10000;     // thermistor nominal resistance
 SoftwareSerial impSerial(8, 9); // RX on 8, TX on 9 for imp
 
 float current_temperature = 22.2222; // in C

  // 331.3 m/s plus .606 * current temp in C
  return 331.3 + (0.606 * current_temperature);
}

  // establish variables for duration of the ping, 
  // and the distance result in inches and centimeters:
  float duration, inches, cm;

  current_temperature = read_thermistor(analogRead(thermistor_pin));
  Serial.print("Current Temp: ");
  Serial.print(current_temperature);
  Serial.println("C");

  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
