     }
   }
 }
+
+
+void update_dual_lever_led(int pin, int number1, int number2) {
+  if (position_is_ok[number1] == false || position_is_ok[number2] == false) {
+    if ((millis() % 500) > 250) {
+      digitalWrite(pin, HIGH);
+    }
+    else {
+      digitalWrite(pin, LOW);
+    }
+  }
+  else {
+    if (movement_allowed(number1) || movement_allowed(number2)) {
+      digitalWrite(pin, LOW);
+    }
+    else {
+      digitalWrite(pin, HIGH);
+    }
+  }
+
+}
+
 
 
 void setup() {


void update_single_lever_led(int pin, int number) {
  if (position_is_ok[number] == false) {
    if ((millis() % 1000) > 500) {
      digitalWrite(pin, HIGH);
    }
    else {

      react_to_movement(number, MINUS);
    }
  }
  // Update the LEDs.
  update_single_lever_led(PIN_LED_SWITCH_5, SWITCH_5);
  update_single_lever_led(PIN_LED_SWITCH_1, SWITCH_1);
  update_single_lever_led(PIN_LED_SIGNAL_A1, SIGNAL_A1);
  update_single_lever_led(PIN_LED_SIGNAL_A2, SIGNAL_A2);
  update_single_lever_led(PIN_LED_SWITCHING_PERMISSION, SWITCHING_PERMISSION);

  update_dual_lever_led(PIN_LED_ROUTE_A, ROUTE_A1, ROUTE_A2);
  update_dual_lever_led(PIN_LED_ROUTE_BERENBACH, ROUTE_BERENBACH1, ROUTE_BERENBACH2);

  if (current_position[ROUTE_A_FIXATION] == PLUS) {
    digitalWrite(PIN_LED_ROUTE_A_FIXATION, LOW);
  }
  else {
    digitalWrite(PIN_LED_ROUTE_A_FIXATION, HIGH);
  }

  // TODO: update the outgoing pins.
}
