Need help with a unipolar stepper

Hi everyone,

I am trying to connect a stepper motor (model minebea C2164-60045), with this code the motor works:

int pin8 = 8;
int pin9 = 9;
int pin10 = 10;
int pin11 = 11;

void setup() {                

  pinMode(pin8, OUTPUT);
  pinMode(pin9, OUTPUT);
  pinMode(pin10, OUTPUT);
  pinMode(pin11, OUTPUT);

}

void loop() {
  digitalWrite(pin8, HIGH);  
  delay(5);               
  digitalWrite(pin8, LOW);    
  delay(2);

  digitalWrite(pin9, HIGH);  
  delay(5);               
  digitalWrite(pin9, LOW);    
  delay(2);        

  digitalWrite(pin10, HIGH);  
  delay(5);               
  digitalWrite(pin10, LOW);    
  delay(2);      

  digitalWrite(pin11, HIGH);  
  delay(5);               
  digitalWrite(pin11, LOW);    
  delay(2);      
}

but when i try to use the stepper library with this code it doesn't work, it only vibrates:

#include <Stepper.h>

const int stepsPerRevolution = 49;  // 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);            

void setup() {
  // set the speed at 60 rpm:
  myStepper.setSpeed(60);
  // initialize the serial port:
  Serial.begin(9600);
}

void loop() {
  // step one revolution  in one direction:
   Serial.println("clockwise");
  myStepper.step(stepsPerRevolution);
  delay(500);
  
   // step one revolution in the other direction:
  Serial.println("counterclockwise");
  myStepper.step(-stepsPerRevolution);
  delay(500); 
}

The stepper library powers the motor this way:

Step C0 C1 C2 C3
1 1 0 1 0
2 0 1 1 0
3 0 1 0 1
4 1 0 0 1

But my motor works this way:

Step C0 C1 C2 C3
1 1 0 0 0
2 0 1 0 0
3 0 0 1 0
4 0 0 0 1

Any ideas on how I can use the stepper library with this motor.

Thanks in advance.

http://www.motors.wrobots.com/PM55L-048-HPG9.php

Can you give us some hardware details ? (motor supply voltage, current etc?)
Start by reducing the speed to the minimum and then increasing it. You can use a pot to an analog pin and map the input value to a speed range saved to a speed variable.

Step C0 C1 C2 C3
1 1 0 0 0
2 0 1 0 0
3 0 0 1 0
4 0 0 0 1

This is called "wave" drive and only one coil is activated at once. The stepper library activates two coils at once and in this mode the motor consumes twice the current and will have roughly twice the torque. Your motor will work with the stepper library provided that you get the windings wired correctly AND the power supply can handle twice the current. If the latter is true, then simply swap pairs of motor wires (with the power off each time) until the motor works.

Warning: disconnecting a motor wire while it is powered is a fairly certain way to destroy a motor driver.

For everything you ever wanted to know about stepper motors, see http://homepage.cs.uiowa.edu/~jones/step/

switch wires C1 and C2