Adding a potentiometer & switch to a Arduino Uno / Seeed Motor Shield v2

So, got the Vilros ultimate starter pack, worked thru the 10 examples with the breadboard to sort of get an understanding for how each function worked, tweaking an example code here and there...now for my real trouble.....

Now end goal is to run a Slider Dolly along a track with a Stepper motor turning a pulley gear that is attached to a pulley belt below that sits in the middle of the tracks and below the dolly. I've got the dolly and track made, just need to rig this Arduino and motor to the dolly now.

I've got an Arduino Uno with a Seeed Motor Shield V2 ontop.
Currently, I've got the Demo #2-link up and running, with my stepper motor.

The code that I've used is in that link, but I'll provide below as well.

Can somebody help me work thru this adding in a switch and potentiometer to this setup?
I'd like to control how slow the slider can track
I'd like to control the slider on and off / change direction. (maybe 2 switches?)

Can I add this many inputs onto a Seeed Motor Shield? Where would I add that code into my current stepper motor demo example? I think I've gotta pull a bunch of what is already in there out?

Thanks for your help in pointing me the right direction.

//  Demo function:The application method to drive the stepper motor.
//  Hareware:Stepper motor - 24BYJ48,Seeed's Motor Shield v2.0
//  Author:Frankie.Chu
//  Date:20 November, 2012
#define MOTOR_CLOCKWISE      0
#define MOTOR_ANTICLOCKWISE  1
/******Pins definitions*************/
#define MOTORSHIELD_IN1	8
#define MOTORSHIELD_IN2	11
#define MOTORSHIELD_IN3	12
#define MOTORSHIELD_IN4	13
#define CTRLPIN_A		9
#define CTRLPIN_B		10

const unsigned char stepper_ctrl[]={0x27,0x36,0x1e,0x0f};
struct MotorStruct
{
	int8_t speed;
	uint8_t direction;
};
MotorStruct stepperMotor;
unsigned int number_of_steps = 200;
/**********************************************************************/
/*Function: Get the stepper motor rotate                               */
/*Parameter:-int steps,the total steps and the direction the motor rotates.*/
/*			if steps > 0,rotates anticlockwise,			   			   */
/*			if steps < 0,rotates clockwise.           				   */
/*Return:	void                      							      */
void step(int steps)
{
	int steps_left = abs(steps)*4;
	int step_number;
	int millis_delay = 60L * 1000L /number_of_steps/(stepperMotor.speed + 50);
	if (steps > 0) 
	{
		stepperMotor.direction= MOTOR_ANTICLOCKWISE;
		step_number = 0; 
	}
    else if (steps < 0) 
	{
		stepperMotor.direction= MOTOR_CLOCKWISE;
		step_number = number_of_steps;
	}
	else return;
	while(steps_left > 0) 
	{
		PORTB = stepper_ctrl[step_number%4];
		delay(millis_delay);
		if(stepperMotor.direction== MOTOR_ANTICLOCKWISE)
		{
			step_number++;
		    if (step_number == number_of_steps)
		    	step_number = 0;
		}
		else 
		{
			step_number--;
		    if (step_number == 0)
		    	step_number = number_of_steps;
		}
		steps_left --;
		
	}
}
void initialize()
{
	pinMode(MOTORSHIELD_IN1,OUTPUT);
	pinMode(MOTORSHIELD_IN2,OUTPUT);
	pinMode(MOTORSHIELD_IN3,OUTPUT);
	pinMode(MOTORSHIELD_IN4,OUTPUT);
	pinMode(CTRLPIN_A,OUTPUT);
	pinMode(CTRLPIN_B,OUTPUT);
	stop();
	stepperMotor.speed = 25;
	stepperMotor.direction = MOTOR_CLOCKWISE;
}
/*******************************************/
void stop()
{
	/*Unenble the pin, to stop the motor. */
	digitalWrite(CTRLPIN_A,LOW);
    digitalWrite(CTRLPIN_B,LOW);
}

void setup()
{
	initialize();//Initialization for the stepper motor.
}

void loop()
{
	step(200);//Stepper motors rotate anticlockwise 200 steps.
	delay(1000);
	step(-200);//Stepper motors rotate clockwise 200 steps.
	delay(1000);
}

Hey welcome (if it's not too late)!

The code just demonstrates the library and hardware with a couple of moves. I didn't read the details but where is the part that you can vary the speed? It seems to just turn the motor at a default speed with steppermotor.speed. Anyway to set that?

If you want a user interface to your control, I recommend a rotary encoder for selecting menu item and controlling speed settings. You can maybe have an option to save a few moves that you can recall at later time.

I have user interfaces that I sell but I don't know if you like them. Let's talk about what you want to see when your project completes. Describe what settings you want for your program.

My goal is to build something similar to this Timelapse Rig. obv not with the pi board, but with the motorshield/arduino

but with the controls of this one - Timelapse Control

So a simple On/Off Switch, a Change Direction Left/Right Switch, and a Knob to control the speed.

I've been trying to figure out what part of the demo/example code to delete out and add in the MotorKnob example.

Thanks for your UI board ref. Someday I would love to build more functionality to this, it would be great to have 2 modes, one for video dolly moves (which would be normal speed to fast). And have another mode for timelapse photography, where the motor moves super slow creeping and I can have the 4 foot dolly move over the whole length over a time of an hour or so. If you have this functionality available I am certainly interested

Cool project! OK, if you want a simple control, I recommend you to go through the AnalogInput example code in arduino IDE under analog. If I were to do this project, I would write functions. But for a newbie, it would be easy to not use functions first. When designing programs, think as if you were that arduino.

First, you can repeatedly sense for key press (start button). When you sense a key press, read the direction switch. I think you should use a toggle switch for direction. Once you get the direction switch, read speed setting. Then set some timer of delay according to the speed setting and set a flag saying it's now running. Next loop it senses the start/stop button again. If it needs to stop, just stop, or otherwise just keep doing what it does, wait and move a small amount.

Here is pseudo code:

void loop()
{
is_start_stop_pressed?
if not, is the rig running (read flag run_stop)
if it is running, move the motor 200 steps (or whatever), then delay according the pot reading
if it is not running, skip to the next loop iteration
if button is pressed then if flag is stop, set flag to run and run motor and delay
if button is pressed then if flag is run, set flag to stop and skip to next loop iteration
}