   return bmpSensor.sealevel(pressure, ALTITUDE);
 }
 
+long getVcc() {
+  // Read 1.1V reference against AVcc
+  // set the reference to Vcc and the measurement to the internal 1.1V reference
+  ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
+
+  delay(2); // Wait for Vref to settle
+  ADCSRA |= _BV(ADSC); // Start conversion
+  while (bit_is_set(ADCSRA,ADSC)); // measuring
+ 
+  uint8_t low  = ADCL; // must read ADCL first - it then locks ADCH  
+  uint8_t high = ADCH; // unlocks both
+ 
+  long result = (high<<8) | low;
+ 
+  result = 1125300L / result; // Calculate Vcc (in mV); 1125300 = 1.1*1023*1000
+  return result + V_OFFSET; // Vcc in millivolts
+}
+
 int averageAnalogRead(int pinToRead)
 {
   byte numberOfReadings = 8;

  out.print(getPressure());
  out.print("&h=");
  out.print(htuSensor.readHumidity());
  out.println("]");
}


//

const float ALTITUDE = 254.8;
const byte V_OFFSET = 100;

const byte BOUNCE_DELAY_MS = 10;
const int UPDATE_RATE_MS = 1000;
