Pin connection.

Below is an example program I copied and pasted.

I understand most of it fairly well.

The problem I have is;
The pins 5,6 and 7,8 are not connected by any wires to the motors of my robot.
How does the UNO board know they are for the motors?
I changed 5,6 to 9,10 pins and it still run fine.

/* Copy and paste the code below into the Arduino software */
int E1 = 6; //M1 Speed Control
int E2 = 5; //M2 Speed Control
int M1 = 8; //M1 Direction Control
int M2 = 7; //M2 Direction Control
void setup()
{
int i;
for(i=5;i<=8;i++)
pinMode(i, OUTPUT);
Serial.begin(9600);
}
void loop()
{
int leftspeed = 255; //255 is maximum speed
int rightspeed = 255;
analogWrite (E1,255);
digitalWrite(M1,LOW);
analogWrite (E2,255);
digitalWrite(M2,LOW);
delay(100);
}

Thank you,
Dale

You changed pins 5 & 6 which are PWM capable pins to 9 & 10 which are also PWM capable so all is well, if you change them to, say, 7 & 8 then not so good.

Thanks for the replies.
Problem solved I think.

I complied the program using pins 9 and 10 but did not upload it.

Tried it again and it did not work with pins 10,9.

On my robot pins 5 and 6 are motor pins.

Dale