Autonomous Arduino tank with seeedstudio motor shield and ping sensor.

Jdawg:
All of these sketchs I did not actually type myself, Most are copied out of arduino examples someone else wrote, so I understand very little of what is going on here.

You probably need to break your project into several parts and test each until you see what is going on. Start with testing the ping sensor by having the output sent to the serial monitor to see if what you get is what you expect.