 
     // attach servo pin and set to initial direction
     ServoMotor.attach(servoPin);
-    ServoMotor.write(servoInitPos);
+    ServoMotor.write(servoCenter);
     ServoMotor.detach();
 }
 

    }

    // obstacle is further away than X cm
    if(wheelSpinCompleted && rangeCenter > rangeLimit_Stop)
    {
        // drive
        SetMotor(motorPin1_1, motorPin1_2, 255);
        SetMotor(motorPin2_1, motorPin2_2, 255);

        rangeLimit_Timestamp = uptime;
    }

    // TODO - slightly turn if side better than center

    else
    {
        if(rangeLeft > rangeRight)
        {
            SetMotor(motorPin1_1, motorPin1_2, 255);
            SetMotor(motorPin2_1, motorPin2_2, -255);
        }
        else
        {
            SetMotor(motorPin1_1, motorPin1_2, -255);
            SetMotor(motorPin2_1, motorPin2_2, 255);
        }

        wheelSpinCompleted = false;

        if(rangeCenter > rangeLimit_Warning3 && (rangeLimit_Timestamp + rangeLimit_RotateFor) <= uptime)
        {
            wheelSpinCompleted = true;
        }
    }
}



    GetRange(servoPos, wheelSpinCompleted);

    // Wait for initial scans before performing any actions
    if(uptime < initialDelay)
    {
