I want to make a obstacle avoiding robot using atmega2560

I want to make a obstacle avoiding robot using Arduino Mega2560. My componets is:

  1. Arduino mega
  2. HC-SR04 Sonar Sensor
  3. This Motor Controller.
  4. 2 Dc Motors.
    How should i connect the components with Arduino Mega2560 and what should be the programming code.

So, one of the DC motors is the hovercraft's lift motor, and the other one controls the steering vanes?

what should be the programming code.

What part of the project are you doing?

Yes AWQL

I'm trying to make a robot which will avoid obstacle. #PaulS

I'm trying to make a robot which will avoid obstacle.

But not the software part. And, apparently, you don't have any hardware assembled, so not the hardware part, either.

So, what part are you doing?

example robot >> arduino obstacle robot

First, build the robot and then ask about programming.

I want to make a obstacle avoiding robot using Arduino Mega2560. My components is:

Get each part working correctly separately, then combine the components in the code. Have you got the sonar unit to output any usable data?