       break;
     }
   }
+
+  disableMotor();
 }
 
 // Stop door motion

const int PIN_LCD_D7      = 2;
const int PIN_LCD_BL      = 9;
// Arduino Uno / Photocell
const int PIN_PHOTOCELL   = A0;
// Arduino Uno / Motor controller
const int PIN_MOTOR_1     = 13; // pin 2 on L293D
const int PIN_MOTOR_2     = 12; // pin 7 on L293D
const int PIN_MOTOR_3     = 11; // pin 15 on L293D
const int PIN_MOTOR_4     = 10; // pin 10 on L293D

// --------------------------------------
// -- Runtime variables

const int STEPS_PER_REVOLUTION              = 200;
const int MOTOR_SPEED_STEPS_PER_SECOND      = ( MOTOR_MAX_RPMS / 60 ) * STEPS_PER_REVOLUTION;
const int MOTOR_ACCEL_STEPS_PER_SEC_PER_SEC = 50;
// Disable motor driver when stopped. Decreases power consumption and heat from motor. 0 = no, 1 = yes.
const int MOTOR_DISABLE_ON_STOP             = 1;

// Number of ticks beyond threshold to wait before changing door position
const int LIGHT_THRESH_TICKS_TO_CHANGE      = 100;
