am sorry -to correct it analogWrite not digital Write and should put change the pin to PWM pin 5 or 6its worked 100%,but because when it forward in full speed .the car Collide in the wall before the ultrasonic detect the wall.so u have to change in code void goForward(){//Enable Motor AdigitalWrite (enableA, 80); 50-80 instead of HIGH//forwarddigitalWrite (pinA1, LOW);digitalWrite (pinA2, HIGH);}
am sorry -to correct it analogWrite not digital Write and should put change the pin to PWM pin 5 or 6its worked 100%,but because when it forward in full speed .the car Collide in the wall before the ultrasonic detect the wall.so u have to change in code void goForward(){//Enable Motor AdigitalWrite (enableA, 80); 50-80 instead of HIGH//forwarddigitalWrite (pinA1, LOW);digitalWrite (pinA2, HIGH);}