// stepper motor with crossed wires 
// for https://forum.arduino.cc/t/accelstepper-run-question/1121994/16
// https://wokwi.com/projects/363629517927347201
// Copied fron https://wokwi.com/projects/360399388158511105

// The center two coil wires are swapped, so the stepper only steps in
// one direction

#include "AccelStepper.h"

// Define a stepper and the pins it will use
AccelStepper stepper(AccelStepper::FULL4WIRE,2,3,4,5); // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5

// This defines the analog input pin for reading the control voltage
// Tested with a 10k linear pot between 5v and GND
#define ANALOG_IN A0

void setup()
{  
  stepper.setMaxSpeed(1000);
}

void loop()
{
  // Read new position
  int analog_in = analogRead(ANALOG_IN);
  stepper.moveTo(analog_in);
  stepper.setSpeed(1000);
  stepper.runSpeedToPosition();
}
Loading chip...chip-scope
Note the crossed wires at the Arduino pins 3&4. This causes one-directional, (CCW) motion.