     //result++;
   }
   decayTime(2);
-  delay(readDelay); 
+  delay(HumReadDelay); 
   //return result;                   // report results   
 }
 
 long decayTime(int input){
   if (input==1){
-    time1=micros();
+    HumTime1=micros();
   }
   if (input==2 ){
-    time2=micros(); 
+    HumTime2=micros(); 
   }
   if (input==3){
-    return (time2-time1);
+    return (HumTime2-HumTime1);
   }
 }
+
+float Temperature(int AnalogInputNumber,float B,float T0,float R0,float R_Balance)
+{
+  float R,T;
+  R=R_Balance*(1024.0f/float(analogRead(AnalogInputNumber))-1);
+  T=1.0f/(1.0f/T0+(1.0f/B)*log(R/R0));
+  T=9.0f*(T-273.15f)/5.0f+32.0f;
+  return T;
+}

void loop()                     // run over and over again
{
  long H=evalHumid(HumReadingsPer, HumSensorPin);
  Serial.println("_____");
  Serial.println(H);
  Serial.println("_____");
  delay(100);

// Arduino Climate Monitor Node
// 30Aug2014
// Adam Green (ndsoccer11122@yahoo.com)

//humidity code credit to dpotthast from arduino forums 
//temp code credit to Milan Malesevic and Zoran Stupid from arduino playground

// HCH-1000 Humidity Sensor
// 10Mohm R1
// 220ohm R2

#include <math.h>
#define Vishay_10K_Therm 4977.0f,298.15f,10000.0f //define thermistor B,To,R


int HumSensorPin = 4;
int TempSensorPin = 0;
float TempBalanceR = 10000;

long HumResult = 0;
unsigned long HumTime1=0;
unsigned long HumTime2=0;

long HumReadingsPer=30.0;
long HumReadDelay=50.0;

void setup()                    // run once, when the sketch starts
{
