Calculating if I'm within 10% of the center of a pot

Krodal:
Are the steering.left and steering.right the raw values from the analogRead() functions ?
Or are they calculated values from 0 to 180 (the degrees for the pot) ?

I assume they are the raw analogRead() values.
Is steering.left always the lower value, or could steering.left be the lower value ?

How do you use the 10%. Do you want the range to be from -5% to +5% around the center ?

I see 3 problems:
(1) Your center is not the range divided by two, but you have to add the steering.right or steering.left (whatever is the lowest value).
(2) Ten percent is "0.1", you use ".01" which is 1%.
(3) A value of "0.1" or ".01" is a floating point value, and you use integers to calculate it. That is not possible.

I used many variable in the next example, to show what is going on.

// example, not tested

boolean StraightAhead( void) {
  int lowest, range, middle;
  int steering, limit_low, limit_high;
 
  lowest = min (steering.left, steering.right);
  range = abs (steering.left - steering.right);
  middle = lowest + (range / 2);
 
  limit_low = middle - (range / 20);       // 5% lower
  limit_high = middle + (range / 20);     // 5% higher
 
  steering = steeringVal();
 
  if (steering > limit_low && steering < limit_high)
    return (true);
  else
    return (false);
}

Thanks, yes, I see all 3 problems, and your were correct.
steeringVal(), steering.left, and steering.right are all raw analog readings, though they typical range from 500-600 min/max, not 0-1024. So I think what you've come up with looks like it will work. I'll make a serial monitor debug loop and check it out. Thanks.