controlling speed

ok I have been working with the motor shield from sparkfun and I need to control the speed of the motor by using a potentiometer this is of course not working correctly I am using a 10K pot in analog pin 0 and the motor shield is connected to pin 11 I am getting no speed from the motors I switched out the 10K and I still get nothing the motor only jitters like it wants to move but can't.

here is my code:

const int potPin = A0;
const int motorPin = 3;

int potVal = 0;
int mapedPotVal = 0;

void setup()
{
  pinMode(potPin, INPUT);
  pinMode(motorPin, OUTPUT);
  analogWrite(motorPin, 5);
}

void loop()
{
  potVal = analogRead(potPin);
  
  mapedPotVal = map(potVal, 0, 1023, 0, 255);
  
  analogWrite(motorPin, mapedPotVal);
  
}

any help would be appreciated thanks

Details would be useful

what kind of details do you want:

I have a Arduino, right now I have a 10K pot hooked up to analog pin 0 and ground, I have the Sparkfun Motor shield and the motor is connected to pin 11 and ground.

and the problem I am having is that when I toggle my pot around the motor just gitters and does not move as it should (I am trying to control motor speed through the PWM)

figured it out made a dumb mistake

thanks

made a dumb mistake

If you own up to the mistake, perhaps someone else can avoid that same mistake, and frustration, in the future.

lol no problem my error was I had no reference voltage so of course my pot wouldn't work this is why I said dumb mistake

ardlab:
lol no problem my error was I had no reference voltage so of course my pot wouldn't work this is why I said dumb mistake

Thanks!