project using stepper motor 28byj-48, uln2003 controller and potentiometer

Hello,

Need some help with a project using a stepper motor 28byj-48 ( 5 VDC ), uln2003 controller and a potentiometer.
I only need to control the stepper motor using a potentiometer ( in this case 10Kohm), turning the knob the motor starts, stop turning the knob, the stepper stops, reverse the knob the stepper also reverse, but the stepper only vibrates. All connections ok. Potentiometer connected to A0. Already check the analog values of the potentiometer, using the serial monitor, and it's ok.
There are something wrong in the code, for sure. Can someone give me a hand, please??
Sorry my english!!!

#include <Stepper.h>


#define STEPS 64


Stepper stepper(STEPS, 8, 9, 10, 11);

int previous = 0;

void setup()
{
   stepper.setSpeed(200);
}

void loop()
{
  int val = map(analogRead(0), 0, 1023, 64 , 0);
  stepper.step(val - previous);
  previous = val;
}

Thanks

Try:

void setup()
{
   stepper.setSpeed(200);
   previous = map(analogRead(0), 0, 1023, 64 , 0);
}

Start with pot in center position.

Thanks, outsider...

But still don't work... :confused:

Here is the code that you suggest...

#include <Stepper.h>


#define STEPS 64


Stepper stepper(STEPS, 8, 9, 10, 11);

int previous = 0;

void setup()
{
   stepper.setSpeed(200);
    previous = map(analogRead(0), 0, 1023, 64 , 0);
}

void loop()
{
  
  stepper.step(previous);
 
}

Still need help!!!

Can you post a diagram of your motor wiring?

Sorry the delay in answering...
The wiring it's like the attachment...

Thanks, outsider...