   attachInterrupt(digitalPinToInterrupt(MOTOR_2_INT_PIN), motor2_interrupt, CHANGE);
   //attachInterrupt(digitalPinToInterrupt(MOTOR_3_INT_PIN), motor3_interrupt, CHANGE);
 
-  #ifdef COMPONENT_TESTING_ROTATION_COAST
-  for (int i = 0; i < 20; i++) {
-    motor1.deg = 0;
-    motor_turn_deg(&motor1, 360, COUNTERCLOCKWISE);
-    if (motor1.deg < 360) {     // In case it happens that the loop breaks out before 360 degrees
-      Serial.println("ERROR");  // thrown an error, because that is not supposed to happen.
-      exit(0);                  // The error should be fixed, but cant be sure yet.
-    }
-
-    delay(1000);
-    Serial.println(motor1.deg); // Value used for component testing.
-                                // Should be 360 + coast degrees for the motor.
-    delay(500);
-  }
-  #endif
+#ifdef COMPONENT_TESTING_ROTATION_COAST
+  component_test_motor_coast(&motor1);
+#endif
 }
 
 void motor1_interrupt() {

  // put your main code here, to run repeatedly:
}


void motor_turn_deg(Motor* motor, int deg, Turning_Direction dir)
{
  int goal = motor->deg + (deg * dir);

  motor_turn(motor, dir);

  switch (motor->dir) {
