 // 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_5 = 2;
-int PIN_OUTPUT_SWITCH_1 = 3;
-int PIN_OUTPUT_SIGNAL_A1 = 4;
-int PIN_OUTPUT_SIGNAL_A2 = 5;
+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;

  pinMode(PIN_LED_ROUTE_BERENBACH, OUTPUT);
  pinMode(PIN_LED_ROUTE_A_FIXATION, OUTPUT);

  // Debug led 13 stuff
  digitalWrite(13, LOW);

  // Attach pins to lever Bounce objects.
  levers[SWITCH_5].attach(PIN_LEVER_SWITCH_5);

}


void update_outputs() {
  // Active: pull to zero.
  if (current_position[SWITCH_1] == PLUS) {
    digitalWrite(PIN_OUTPUT_SWITCH_1, HIGH);
  }
  else {
    digitalWrite(PIN_OUTPUT_SWITCH_1, LOW);
  }
  if (current_position[SWITCH_5] == PLUS) {
    digitalWrite(PIN_OUTPUT_SWITCH_5, HIGH);
  }
  else {
    digitalWrite(PIN_OUTPUT_SWITCH_5, LOW);
  }
  if (current_position[SIGNAL_A1] == PLUS) {
    digitalWrite(PIN_OUTPUT_SIGNAL_A1, HIGH);
  }
  else {
    digitalWrite(PIN_OUTPUT_SIGNAL_A1, LOW);
  }
  if (current_position[SIGNAL_A2] == PLUS) {
    digitalWrite(PIN_OUTPUT_SIGNAL_A2, HIGH);
  }
  else {
    digitalWrite(PIN_OUTPUT_SIGNAL_A2, LOW);
  }
}


void change_position(int number,
                     boolean new_position) {

  current_position[number] = new_position;
  position_is_ok[number] = true;

  update_requirements();
  update_blocks();
  update_outputs();

  // Special case: signals going back to PLUS free the route fixation.
  // It also marks the related route as disallowed so that the handle
  // shows up as having to change.
  if (number == SIGNAL_A1 || number == SIGNAL_A2) {
    if (new_position == PLUS) {
      if (current_position[ROUTE_A1] == MINUS) {
        position_is_ok[ROUTE_A1] = false;
      }
      if (current_position[ROUTE_A2] == MINUS) {
        position_is_ok[ROUTE_A2] = false;
      }
      change_position(ROUTE_A_FIXATION, PLUS);
    }
  }
