Arduino-Serial DC Motor Control ?'s

I’m super sorry if this is posted somewhere else but i need to ask this quickly…
I am a real beginner to arduino, and a really new member to the forum
I used BASIC before hand and have a little programming knowledge; currently i have an UNO set up with a Motor-shield V3 to control two DC motors with the serial monitor. All i know how to do is set the motors to HIGH or LOW, not to control their speed, so that is the first issue. Second, how can i send data as i type it, as in “Go Forward until W is released” + can someone help me look for redundancy in the coding?
I’ve included my code

//MOTOR CONTROL
int dirA = 12; //Define Pins To Control Motor
int dirB = 13;
int speedA = 3;
int speedB = 11;

void setup() {
Serial.begin(9600); //Serial Comunication at BAUD of 9600
pinMode (dirA, OUTPUT);
pinMode (dirB, OUTPUT);
pinMode (speedA, OUTPUT);
pinMode (speedB, OUTPUT);
} 


int Forward(){
digitalWrite (dirA, LOW);
digitalWrite (dirB, LOW);
digitalWrite (speedA, HIGH);
digitalWrite (speedB, HIGH);
}

int Reverse(){
digitalWrite (dirA, HIGH);
digitalWrite (dirB, HIGH);
digitalWrite (speedA, HIGH);
digitalWrite (speedB, HIGH);
}

int Left(){
digitalWrite (dirA, HIGH);
digitalWrite (dirB, LOW);
digitalWrite (speedA, HIGH);
digitalWrite (speedB, HIGH);
}

int Right(){
digitalWrite (dirA, LOW);
digitalWrite (dirB, HIGH);
digitalWrite (speedA, HIGH);
digitalWrite (speedB, HIGH);
}
int Stop(){
digitalWrite (dirA, LOW);
digitalWrite (dirB, LOW);
digitalWrite (speedA, LOW);
digitalWrite (speedB, LOW);
}

void loop(){

if (Serial.available() > 0) {
int inByte = Serial.read();

switch (inByte) {      //following are subroutines for their corresponding function

case 'w': 
Forward();
break;

case 's': 
Reverse();
break;

case 'a': 
Left();
break;

case 'd': 
Right();
break;

case 'q':
Stop();
break;

default:
digitalWrite (speedA, HIGH); //All of This is Just to Say STOP the Motors
digitalWrite (speedB, HIGH);
digitalWrite (dirA, LOW);
digitalWrite (dirB, LOW);

} 
}

}

I would love a bit of sample code to help me get started
Thanks

Also, is there a way to shrink the code?

Hit modify, select the entire code and press that # button in that toolbox above your message.

Post a link to what motor shield you're using - is there a reason that you're not using the (probably) provided library for it? That will make speed control easy. If you don't use it, check out the analogWrite() function.

That code looks like it should do what you want - does it? If not, post exactly what it does and what you want it to do.

Ha ha thanks, i meant shrink the physical code, like find redundancies :)

Here is the shield: http://arduino.cc/en/Main/ArduinoMotorShieldR3

I want to be able to push "W" or any other character and instantly have the data read by the board, then when i let go, have the board stop receiving the signal. Currently everything works fine, but i have to push W and then enter, then Q to make the robot stop. i want the motor to run until i let go of the key...

Ultimately i am going to turn this into a bluetooth bot, then have it controlled by my android device for a class presentation, but until then i need an on key action.

If you want instant response to key presses, you'll need to use something other than the serial monitor. Some here have suggested using hyper-terminal on windows, as that sends keys as they are pressed. You could also write a small program, using Visual Basic/C#/etc or processing to read key presses and pass them to the arduino.

default:
digitalWrite (speedA, HIGH); //All of This is Just to Say STOP the Motors
digitalWrite (speedB, HIGH);
digitalWrite (dirA, LOW);
digitalWrite (dirB, LOW);

How come the code to STOP is the same as the code for Forward ()?

Also, rather than shrinking it, can I suggest growing it a little:

const int dirA = 12;
const int dirB = 13;
const int speedA = 3;
const int speedB = 11;

and

void Forward()
{
  digitalWrite (dirA, LOW);
  digitalWrite (dirB, LOW);
  digitalWrite (speedA, HIGH);
  digitalWrite (speedB, HIGH);
}

dxw00d: If you want instant response to key presses, you'll need to use something other than the serial monitor. Some here have suggested using hyper-terminal on windows, as that sends keys as they are pressed. You could also write a small program, using Visual Basic/C#/etc or processing to read key presses and pass them to the arduino.

FWIW "BlueTerm" in the Android Market sends on press. It's free. Using it over BT to my weather station.

That's another option. I also use touchOSC on my iPhone, which allows quite smart user interfaces to be built. It does need an intermediate process between the iPhone and the ardiuno though.

Thanks, I will give those programs a try. As to why the stop and start codes are the same, i must've labeled the code wrong, case "q" is made to initiate the stop code, and the defined subroutine is written in the setup