   pinMode(PIN_LED_ROUTE_BERENBACH, OUTPUT);
   pinMode(PIN_LED_ROUTE_A_FIXATION, OUTPUT);
 
+  // Attach the output pins
+  pinMode(PIN_OUTPUT_SWITCH_1, OUTPUT);
+  pinMode(PIN_OUTPUT_SWITCH_5, OUTPUT);
+  pinMode(PIN_OUTPUT_SIGNAL_A1, OUTPUT);
+  pinMode(PIN_OUTPUT_SIGNAL_A2, OUTPUT);
+
   // Debug led 13 stuff
   digitalWrite(13, LOW);
+
+  // First make sure the output pins are OK
+  update_outputs();
 
   // Attach pins to lever Bounce objects.
   levers[SWITCH_5].attach(PIN_LEVER_SWITCH_5);

  }

}



void setup() {

// Push button for route fixing
int PIN_BUTTON_ROUTE_A_FIXATION = 46;
// Output pins (pull to 0 means go out of the ground position)
int PIN_OUTPUT_SWITCH_1 = A1;
int PIN_OUTPUT_SWITCH_5 =A2;
int PIN_OUTPUT_SIGNAL_A1 = A5;
int PIN_OUTPUT_SIGNAL_A2 = A4;


// Array index numbers. These are columns in the locking table.
int SWITCH_5 = 0;
