Arduino 4wd robot & Ping))) sensor

Eric has an interesting project called "Arduino 4wd robot & Ping))) sensor" Arduino 4wd robot & Ping))) sensor | AK Eric

I changed the original code robot4wd_06.pde http://www.akeric.com/arduino/robot_4wd/robot4wd_06.pde to suit my project http://robotx.ro/download/NAVIGATOR_test.pde

The problem is he uses Adafruit Motorshield Motor Shield - Arduino motor/stepper/servo control with AFMotor.h and I use L298_Motor_Shield Loading...

The robot acts strange, it does not stop when detecting obstacles, any ideas ?

The sketches are too long for me to read. However, the way to deal with all such problems is
task decomposition and modular development. Write separate sketches for motor control and
sensor reading. Verify each works properlyseparately on its own, then combine into a common
sketch.

IOW, write a sketch to test the sensor alone, and verify it is sending back the correct data.
Ping it, read it, and then send the result out the serial port.

Do similar for motor control. Easy way - just tell the motors to go forwards for 1-2 sec, then
backwards, then left, then right. Trivial sketch.

Once each sketch is verified to work alone, then combine. The most common problem with using
someone else's sketch is probably in not having the devices connected to the same I/O pins on
the Arduino.