 #include <avr/sleep.h>
 #include <avr/power.h>
+#include <avr/wdt.h>
 
 #include <LiquidCrystal.h>
 #include <Wire.h>

      enterSleep();
    }
  }
}

  // loop until limit switch is hit  (also add timeout)
  Serial.print("Waiting for door to close");
  while(digitalRead(PIN_LIMSW_DN) == LOW){
    wdt_reset();
    delay(DELAY_MS);
    timeoutcount++;
    if(timeoutcount > TIMEOUT_MAX){
