I have to agree with the OP (Legoaceking) here. If Arduino is going to release reference schematics, then they should be putting simple code examples in the web pages for those reference schematics.
Here's the basics.
The Motor shield will drive 2 brushed DC motors. There are 2 control signals per motor. The control signals are DIRECTION and SPEED.
DIRECTION is a digital output port set to "1" for one direction, and "0" for the other. SPEED is also a digital output port, but it's special. It's set to high only for a percentage of the time. That percentage is set by a function called analogWrite().
analogWrite() doesn't actually output an analog signal. What it does is set up a digital output bit to be high for a percentage of the total time. For more info, check the reference info here: http://www.arduino.cc/en/Reference/HomePage
PRO TIP: Googling "Arduino Reference" will get you right to it.
The Arduino motor shield uses 4 digital output ports to control the 2 motors. They are assigned to these ports:
Direction: port 13
Speed: port 3
Direction: port 12
Speed: port 11
Why they chose these ports I'll never know. They directly interfere with the primary communication channel of the Arduino... the SPI system. This is the system that ALL the major communication shields use. As such, you cannot use the motor shield along with a WiFly shield, a USB Host shield, an Ethernet shield, or a micro-SD shield. All of these use digital ports 10, 11, 12, and 13. Which are the digital ports used by the SPI system.
So. To use the motor shield to run a motor, you set a direction and a speed by setting the ports for that motor.
First. Set the pin mode of the ports you need to use.
For Motor A:
For Motor B:
To set motor A to 50% speed going in direction 1:
Hmm. Which direction is "Direction 1"? Try it and see! If it's the wrong way, just reverse the motor wires.
To set motor A at zero speed: (The direction port really doesn't matter with 0 speed.)
To set motor A at max speed:
As you can see, the range of the speed you can set is 0 to 255.
To set motor B at zero speed: (The direction port really doesn't matter with 0 speed.)
To set motor B at max speed: