Running a robot with 2 front-facing sensors, but it's stuttering
your updateDirection logic doesn't quite work the way you think it does.

after a bit of code formatting and comments it looks like this:

void updateDirection() {

    if (distanceInchR &lt; minDistanceInch &amp;&amp; distanceInchL &lt; minDistanceInch) {
        if (movement != BACK) {
            backUp();
        } else if (distanceInchR &lt; minDistanceInch) {
            //always entered if movement == BACK
            if (movement != TURNFL) {
                turnFL();
            }
        } else if (distanceInchL &lt; minDistanceInch) {
            //never entered
            if (movement != TURNFR) {
                turnFR();
            }
        } else if (distanceInchR &gt; minDistanceInch &amp;&amp; distanceInchL &gt; minDistanceInch)
            //never entered
            if (movement != FORWARD) {
                forward();
            }
        //endif distanceInchR &lt; minDistanceInch &amp;&amp; distanceInchL &lt; minDistanceInch
    } else {
        // entered when distanceInchR &gt; minDistanceInch || distanceInchL &gt; minDistanceInch
        if (movement != STILL) {
            still();
        }
    }
}


it looks like you had a missing closing brace around the first condition. Causing the only movement functions that get called to be backUp, turnFL and still.

If we add the missing braces then it looks much better: 

void updateDirection() {

    if (distanceInchR &lt; minDistanceInch &amp;&amp; distanceInchL &lt; minDistanceInch) {
        if (movement != BACK) {
            backUp();
        } 
    } else if (distanceInchR &lt; minDistanceInch) {
        if (movement != TURNFL) {
            turnFL();
        }
    } else if (distanceInchL &lt; minDistanceInch) {
        if (movement != TURNFR) {
            turnFR();
        }
    } else if (distanceInchR &gt; minDistanceInch &amp;&amp; distanceInchL &gt; minDistanceInch) {
        if (movement != FORWARD) {
            forward();
        }
    } else {
        if (movement != STILL) {
            still();
        }
    }
}