   }
   else {
     digitalWrite(fan, HIGH);
-    digitalWrite(fanSpeed, HIGH);
+    digitalWrite(fanEnable, HIGH);
     if (Debugging) {
       debugger.println("Fan on.");
     }

      // Door isn't closed, run motor until it is.
      digitalWrite(doorClose, HIGH);
      digitalWrite(doorOpen, LOW);
      digitalWrite(doorSpeed, HIGH);
    }
    else {
      // Door is closed, stop motor
      digitalWrite(doorClose, LOW);
      digitalWrite(doorOpen, LOW);
      digitalWrite(doorSpeed, LOW);
      doorState = "closed";
      if (doorStatePrev != doorState && wifiConnected) {
        mqtt.publish("coop/status", "door|closed", 2, 0);

      // Door isn't open, run motor until it is.
      digitalWrite(doorClose, LOW);
      digitalWrite(doorOpen, HIGH);
      digitalWrite(doorEnable, HIGH);
    }
    else {
      // Door is open, stop motor.
      digitalWrite(doorClose, LOW);
      digitalWrite(doorOpen, LOW);
      digitalWrite(doorEnable, HIGH);
      doorState = "open";
      if (doorStatePrev != doorState && wifiConnected) {
        mqtt.publish("coop/status", "door|open", 2, 0);
