@retrolefy
Thanks for the good advice. I will use it as an digital pin. I also prefer that a lot more.
But do i still need to at this line:
pinMode(doorSensor, INPUT)
Not really required, as all pins upon power up or reset default to input pins, however it's best to do it anyway in my opinion as it gives the reader (and even you a year from now) of your code a clear understanding of what pins are being used later in the sketch.
Lefty