Please help With modifying stepping motor speed

So I'm an extreme newbie at this and I have a project I'm working on could somebody please modify the example in the Arduino IDE of the stepper motor speed example. I'd like my stepper motor to turn 20 turns clockwise 20 turns in reverse and then repeat speed being based on the position of a potentiometer
I would very much appreciate your assistance

What school assignment are you doing this for ?

its my own project

Hello slowelon
Keep it simple and stupid firstly.
Run some tutorials for the hardware selected.
If you are happy with the results of the tutorials you can merge these to your project.
Have a nice day and enjoy coding in C++.

thank you for replying I really appreciate it I was hoping to just find a code and stick it in upload it i'm using anemia 17 stepper motor l298 and bridge ardrino Uno and a potentiometer from the Arduino elegoo kit, everything works according to the example in the Arduino IDE for stepper motor speed I just wanted to rotate when he turns only 20 turns reverse base based on and repeat based on position osition of the pod sorry for rambling so much

Show us your circuit schematic.

And your code...

should I try to do design it in tinkercad and then upload it here the schematic or the wiring diagram

/*
Stepper Motor Control - speed control

This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 - 11 of the Arduino.
A potentiometer is connected to analog input 0.

The motor will rotate in a clockwise direction. The higher the potentiometer value,
the faster the motor speed. Because setSpeed() sets the delay between steps,
you may notice the motor is less responsive to changes in the sensor value at
low speeds.

Created 30 Nov. 2009
Modified 28 Oct 2010
by Tom Igoe

*/

#include <Stepper.h>

const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

int stepCount = 0; // number of steps the motor has taken

void setup() {
// nothing to do inside the setup
}

void loop() {
// read the sensor value:
int sensorReading = analogRead(A0);
// map it to a range from 0 to 100:
int motorSpeed = map(sensorReading, 0, 1023, 0, 100);
// set the motor speed:
if (motorSpeed > 0) {
myStepper.setSpeed(motorSpeed);
// step 1/100 of a revolution:
myStepper.step(stepsPerRevolution / 100);
}
}

You must be following a schematic here.

We are not picky, a hand drawn version is okay.

OK i'll see what I can get together I really appreciate anybody's help in your help I just wanna get my project rolling along i'm not gonna be a big coder or anything and i'm doing voice to text and it's not working out very well right now I will get back to you thank you so much

So the setup works the potentiometer just the RPM OK
just looking to add multiple revolutions approximately 20 clockwise and counter clockwise

Write a test sketch to step the motor.

How many steps are needed to make one revolution ?


200

Does the motor go one full revolution CW then CCW.

const int STEPS_PER_REV = 200;
. . .
myStepper.step(STEPS_PER_REV );
. . .
myStepper.step(-STEPS_PER_REV );

I'm looking to have the motor turned 20 turns clockwise then 20 turns counterclockwise the amount of rotation determined by my and I may adjust the amount of turns but I just don't know how to combine or where to modify modify the above code

myStepper.step(STEPS_PER_REV * 20 );

if there are 200 steps per revolution and I wanted 20 revolutions wouldn't it be 4000

Bad choice. The L298 is not a stepper motor driver. Pick another tutorial.