How to make wall/obstacle avoiding robot with arduino uno atmega 328

As I originally suggested, the best thing to do is learn how to operate the motors separately from the sensors, and the sensors separately from the motors, and after you do that, only then combine the two together.