L298 problem to drive motors

I am new to the arduino and L298. I have uploaded the following code to my arduino. The 4 LED of IN1-4 light up properly in the order of my program. However, the motors do not move. What is the problem? Is there anything that I miss. Thx.

int pinI1=5;
int pinI2=6;
int speedpin=1;
int pinI3=10;
int pinI4=11;
int speedpin1=9;
void setup()
{
pinMode(pinI1,OUTPUT);
pinMode(pinI2,OUTPUT);
pinMode(speedpin,OUTPUT);
pinMode(pinI3,OUTPUT);
pinMode(pinI4,OUTPUT);
pinMode(speedpin1,OUTPUT);
}
void loop()
{
//
analogWrite(speedpin,100);
analogWrite(speedpin1,100);
digitalWrite(pinI4,LOW);
digitalWrite(pinI3,HIGH);
digitalWrite(pinI1,LOW);
digitalWrite(pinI2,HIGH);
delay(2000);
//
analogWrite(speedpin,100);
analogWrite(speedpin1,100);
digitalWrite(pinI4,HIGH);
digitalWrite(pinI3,LOW);
digitalWrite(pinI1,HIGH);
digitalWrite(pinI2,LOW);
delay(2000);
//
analogWrite(speedpin,60);
analogWrite(speedpin1,60);
digitalWrite(pinI4,LOW);
digitalWrite(pinI3,HIGH);
digitalWrite(pinI1,HIGH);
digitalWrite(pinI2,LOW);
delay(2000);
//
analogWrite(speedpin,60);
analogWrite(speedpin1,60);
digitalWrite(pinI4,HIGH);
digitalWrite(pinI3,LOW);
digitalWrite(pinI1,LOW);
digitalWrite(pinI2,HIGH);
delay(2000);
//
digitalWrite(pinI4,HIGH);
digitalWrite(pinI3,HIGH);
digitalWrite(pinI1,HIGH);
digitalWrite(pinI2,HIGH);
delay(2000);
}

_298n_demo.ino (1.87 KB)

What type of motor are you trying to control? Post a link to the motor datasheet if you can.
What power supply are you using for the motor (volts and amps)?
Make a pencil drawing showing how everything is connected and post a photo of the drawing.

What Arduino are you using
analogWrite() only works on the pins designated for PWM output. Pin 1 is not one of them.

…R