Continue rotaation of stepper motor

How can i do slow to fast continue rotation by using potentiometer in Nema-17 Stepper motor?

You might need to read the value of the potentiometer and calculate with that the speed and apply the speed with MyStepperMotor.setSpeed(speed);