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