Control speed of DC Motor with potentiometer

sensorValue = analogRead(analogInPin)/4;            
  outputValue = map(sensorValue, 0, 1023, 0, 255);

Why bother with the map?
And yes, why haven't you shown the code you're using?

Maybe your speed problem would be solved if you used a PWM pin for the output.