   {
     if (PIN_DISABLED(pin))
       continue;
-      
+
     unsigned int newRead = analogRead(pin);
+
     //Serial.println(newRead, DEC);
     if (newRead != _previousReads[pin])
       modified = true;
     _previousReads[pin] = newRead;
-    
+
     digitalWrite(_pinProbeSupplyBase + pin, LOW);
   }
 

    digitalWrite(_pinProbeSupplyBase + pin, HIGH);
  }
  // takes about 15uS to stabilize and the enabling process takes 6us per pin at 16MHz
  delayMicroseconds(10);  
}

void checkTemps(void)

  transmitTemps(2);
}

void stabilizeAdc(void)
{
  if (_pinBattery != 0xff)
  {
    unsigned int last;
    unsigned int curr = analogRead(_pinBattery);
    unsigned int cnt = 0;
    // Reads the adc a bunch of times until the value settles
    // Usually you hear "discard the first few ADC readings after sleep"
    // but this seems a bit more scientific
    do {
      ++cnt;
      last = curr;
      curr = analogRead(_pinBattery);
    } while ((cnt < 10) && (abs(last - curr) > 2));
  }
}

void loop(void)
{
  sleepSeconds(_sleepInterval);
  stabilizeAdc();
  checkTemps();
}

