Help in programming!

Hi, i have an arduino duemilanove with a Arduino-2 Amp Motor Driver Shield(L298P), and 2 DC motors. and i would like to pre program how the motors spin (Aspects such as its speed). Im sure this is possible. What my final goal is to drive my device through a maze without any external interactions. This is done by a 2 wheeled device, with 2 separate motors controlling its 2 separate wheels. I have got the motor running, but am unable to control how the motor speed changes over time.

Here is a mind map of what i want...

motor A and B run at full speed for 3 seconds.

motor A stops, While motor B runs at half speed for 1 second.

motor A and B then again run at full speed for 3 seconds.

How can i make this happen?

This shield? http://arduino.cc/en/Main/ArduinoMotorShieldR3

Simplest way is to connect the motor as directed, then control these pins:

Function pins per Ch. A pins per Ch. B Direction D12 D13 PWM D3 D11

after doing the variable declarations & pinMode stuff:

digitalWrite (D12, LOW); // direction digitalWrite (D13, LOW); // direction

analogWrite (D3, 255); // With PWM: 0 = stop, 255 = full on analogWrite (D11, 255); delay (3000);

analogWrite (D3, 0); analogWrite (D11, 127); delay (1000);

analogWrite (D3, 255); // 0 = stop, 255 = full on analogWrite (D11, 255); delay (3000);

analogWrite (D3, 0); // 0 = stop, 255 = full on analogWrite (D11, 0);

CrossRoads:
This shield?
http://arduino.cc/en/Main/ArduinoMotorShieldR3

Simplest way is to connect the motor as directed, then control these pins:

Function pins per Ch. A pins per Ch. B
Direction D12 D13
PWM D3 D11

after doing the variable declarations & pinMode stuff:

digitalWrite (D12, LOW); // direction
digitalWrite (D13, LOW); // direction

analogWrite (D3, 255); // With PWM: 0 = stop, 255 = full on
analogWrite (D11, 255);
delay (3000);

analogWrite (D3, 0);
analogWrite (D11, 127);
delay (1000);

analogWrite (D3, 255); // 0 = stop, 255 = full on
analogWrite (D11, 255);
delay (3000);

analogWrite (D3, 0); // 0 = stop, 255 = full on
analogWrite (D11, 0);

actually its this sheild:

http://www.diybin.com/products/DFRobot-2A-Motor-Shield-FOR-Arduino.html

i believe the pin arrangement on this is different… but if modify that it should all work the same tho yes? If not, please guide me once again. Thank you very much.

I am sure it is similar. Find the documentation on it. I didn't see any.

Manual
http://www.dfrobot.com/wiki/index.php?title=Arduino_Motor_Shield_(L298N)_(SKU:DRI0009)
Schematic
http://www.dfrobot.com/image/data/DRI0009/Arduino%20L298%20Shield%20Sch.pdf

//Arduino PWM Speed Control?
int E1 = 6;   
int M1 = 7;
int E2 = 5;                         
int M2 = 4;                           
 
void setup() 
{ 
    pinMode(M1, OUTPUT);   
    pinMode(M2, OUTPUT); 
} 
 
void loop() 
{ 
  int value;
  for(value = 0 ; value <= 255; value+=5) 
  { 
    digitalWrite(M1,HIGH);   
    digitalWrite(M2, HIGH);       
    analogWrite(E1, value);   //PWM Speed Control
    analogWrite(E2, value);   //PWM Speed Control
    delay(30); 
  }  
}