 unsigned long t;
 boolean level = LOW;
 unsigned long nowt;
+static int microwait = 500;
 
 void setup() {
   Serial.begin(19200);

static const int VCCPin = 8;
static const int analogPin = 1;
static const int R = 15000;
static const float Vref = 5.0 * 15 / (15 + 51);

static float a = 2.76366367;
static float b = -32.40924966;

}

float GetHumidity(void) {
  float hum;
  val = analogRead(analogPin);
  float volt = val * 5.0 / 1024;
  if (volt < Vm) {
    hum = 100.0;
  } else if (volt > Vref) {
    hum = 0.0;
  } else {
    float res = Re / ((Vref-Vm)/(volt-Vm) - 1);
    float reslog = log10(res);
    hum = a * reslog*reslog + b * reslog + c;
    if (hum > 100.0) {
       hum = 100.0;
    } else if (hum < 0.0) {
       hum = 0.0;
    }
  }
  return (hum);
}
