USING THE SN754410 WITH EXTERNAL POWER SUPPLY

I trying to use the sn754410 to move and old toy (forward/reverse)with the arduino UNO.
this doesnot have a 9 volts supply so I use an external one,
Can anyone tell me if there is anything wrong with the code?

Thnks
Moe

[//ARDUINO CODE FOR SN754410 H-BRIDGE
//MOTOR FORWARD AND REVERSE
//MOETECH INC.

int speedPin = 3; //enable pin for speed motor
int forward = 6; //moving forward
int reverse = 7; //moving reverse
int ledPin = 13; //status led
int speed_value_motor; //value for speed motor

void setup()
{
pinMode(speedPin, OUTPUT);
pinMode(forward, OUTPUT);
pinMode(reverse, OUTPUT);
pinMode(ledPin, OUTPUT);
}

void loop()
{

//MOTOR FORWARD
digitalWrite(forward,HIGH);
digitalWrite(reverse,LOW);
//CONTROL THE SPEED 0-255
speed_value_motor = 120; //1/4 of the speed
analogWrite(speedPin, speed_value_motor);

}

A link to whatever a SN754410 is would be helpful. A schematic showing how you have connected it to the Arduino (and the motors and power supply to it) is essential.

Can anyone tell me if there is anything wrong with the code?

You can. The code does something, but you haven't explained what that is. You want it to do something, but you haven't explained what that is. But, you want us to explain why the two are different. I'll pass for now.

I think the code looks ok, so you probably have it hooked up wrong. Should
have 5V on the h-bridge logic voltage pin, which is separate from the motor
voltage pin.