     Serial.print("|");
     Serial.println(rangeFront);
 
-    if(rangeBack < 5) { rangeBack = maxDistance; }
+    if(rangeBack < minDistance) { rangeBack = maxDistance; }
     if(rangeBack > maxDistance) { rangeBack = maxDistance; }
     Serial.print("Ultrasonic");
     Serial.print("|");


uint8_t servoPos = 90;
direction servoMovement = right;

// ------------------------------
//            SETUP

    // attach servo pin and set to initial direction
    ServoMotor.attach(servoPin, 450, 2400); // 400, 2600 to fix rotation issues
    ServoMotor.write(servoPos);
    
    servoRotationAngel = servoRotationAngelMedium;
}

