so to drive the motor, you need two values
first you need to set whether it goes forward and backward (by setting the apropreate pin to high or low) then you need to set the speed (by pulsewidth modulating the correct bin (analogWrite set to a value between 0 and 255).
(google PWM, if you dont know what it is.)
cheers
p.