Need help with code

I am doing a obstacle avoiding robot using my arduino uno r3 and a adafruit v1 motor shield the ahield shows simple labs shield i tries many codes i found online but even one wont work the motors work but it doesn't avoid obstacle don't know whats the problem

Well, neither do we!

If you can describe your problem, and explain how everything is connected with all the necessary diagrams, actual Web links to the parts you are using, perfectly focussed photographs and show using "code" tags what code you have tried, something might just be possible.

How are you detecting obstacles?