   digitalWrite(pirPin, LOW);
   pinMode(relayPin, OUTPUT);
   digitalWrite(relayPin, HIGH);
+  pinMode(buttonPin, INPUT);
+  digitalWrite(buttonPin, HIGH);
   //delay(20000); // Wait for PIR to warm up
   Serial.begin(9600);
+}
+
+String checkButton() {
+  int state = digitalRead(buttonPin);
+  if (state == HIGH) {
+    return "UNPRESSED";
+  } else {
+    return "PRESSED";
+  }
 }
 
 String checkDoor() {

  if(currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;   
    checkRelay();
    Serial.println(checkDoor() + ":" + checkMotion());
    digitalWrite(ledPin, ledState);
  }
}

const int sensorPin =   2;      // the number of the door sensor pin
const int pirPin =      3;      // the number of the motion detector pin
const int relayPin =    4;      // the number of the door opening relay pin
const int buttonPin =   5;      // the number of the button switch pin


// Variables will change:
