Obstacle avoidance with an UGV -HELP PLEASE-

DistanceGP2Y0A21YK Dist01;  //defines Dist01 as the sharp GP2Y0A21YK

Really? I'd never have guessed. :slight_smile:

  Dist01.begin(A0);    //tells program "Dist01" will be used by the serial monitor

That statement does NOT do what the comment says.

You should look at arrays for similar things.

/*

Although below, it says "getDistanceCentimeter", it really converts the data into Inches---make a very big note for this!!

*/

Or get smart and rename the function.

if ((Prox01 <= 10) || (Prox02 <= 10))
  Steering.write(125);
else if ((Prox04 <= 10) || (Prox05 <= 10))
  Steering.write(65);
else if ((Prox01 <= 15) || (Prox02 <= 15))
  Steering.write(115);

This collection of if tests is way too complicated. There has to be a simpler way.

How are the sensors oriented?