Arduino Motor Shield Stepper Motor control with Joystick

well ok i had the chance to study the code, From what i can say is that the code have some part that need to be change for instant

const int spr = 200; // motor steps per revolution

this part is the part which dictate how much step the stepper would take to complete a rotation.
i would recommend to you to put the total number of step it take for your set up form its start position on the far left to the far right or vice versa. How ever this is not something that is really must needed and you could actually make it variable.... maybe by making use of the other axis of your joystick?

anyway part that really control the speed of your setup is this one

stepper.setSpeed(75);

this is the part that call for the speed of how fast the stepper rotate.
if my understanding of your project is correct, this part need to be implemented in the loop function and now the setup function cause it need to be variable. However before you impliment any of the changes that i suggest, i would recommend that you play with the value 75 that is in the code with something that is higher up until the point your motor stall. This would mean, that the value you got there is the max speed that the stepper could go. one more thing is would also suggest that you do this with the full load of your setup. this is to make sure that you get the most accurate value for your setup and not just something that is calculated or theoretical.

ok now for the pseudo code ( only the loop part but i thing you would get the idea well)

void loop()
{
  PVal=analogRead(Pot1);
  if (PVal >= 507 || PVal <= 517)
  { // fill in with the one you need to make it brake
  }
  if (PVal > 517 )
  {
    int K= map (Pval, 518,1023,0,MAX); /* max is the value that you get from your experiment with the max speed of the stepper before stalling*/ 
     stepper.setSpeed(K); this set the speed of the stepper motor
     stepper.step(spr); this set the direction and the number of step it would take
   }
 if (PVal < 507 )
  {
    int K= map (Pval, 0,506,0,MAX); /* max is the value that you get from your experiment with the max speed of the stepper before stalling*/ 
     stepper.setSpeed(K); //this set the speed of the stepper motor
     stepper.step(-spr); //this set the direction and the number of step it would take
   }

this should help you with your project anyway keep us posted and if you be kind enough to send us a link to a you tube showing how it work would be great .