I capture the readings into an array. I then use a function that returns the reading that represents the closest object in inches. Now, I have to figure out how to use the reading to make precise turns with DC motors.
Check which array element you get the closest reading from. Lower numbered will be left (or right, depending on which way the servo was panning) and higher numbered array indexes will be right (or vice versa).
with DC motors, even a variation of the batteries driving the DC motors will make a difference in the turn.
If you need really tight precision, then quadrature encoders on the wheels or motor shafts will let you measure movement. But that's rather expensive/complicated and there's an easier way: you can use empirical measurements to determine how much battery voltage affects motor speed.
Add a resistor voltage divider between battery + and - and connect it to an analog pin. Select resistor values such that on full batteries the voltage divider reads about 1.0 to 1.1V (make sure both resistors are over 1K):
Set the Arduino analog reference to the internal 1.1V:
Now in software you can measure battery voltage. Time (with a stopwatch) how long it takes to execute a 90° turn on both fully charged and almost dead batteries (also note the analog pin readings for both cases). Using this information, you can write a simple equation to decide how much to adjust turn times based on the battery reading. The actual battery discharge graph will be a curve rather than linear, so you might want to take another sample with half-charged batteries, depends on how accurate you want to be.