I have this code turing a stepper motor one direction one revolution and then the other one revolution and its working but I dont know how to modify it to half step the motor. the driver board is a 5804 unipolar driver and its got 4 input connections (direction, step input, half step, one phase). Pin 8 of the arduino is connected to the step input, pin 9 of arduino is connected to half step input, pin 10 is connected to one phase input and pin 11 to the direction input. I having trouble seeing how I could add a line of code to half step the motor as pin 9 is connected to the half step input and is being used by the stepsPerRevolution command whatever this means. Is this stepPerRevolution command sending out a pulse to each pin(8-11) to get it to turn in one direction and then reversing (11-8) to get it to turn the other direction. I am doin this for a project in college and im struggling as it is all new to me so if anyone could help it would be much appreciated. Below is the code
#include <Stepper.h> //including the stepper library
const int stepsPerRevolution = 850; // turning motor 850 steps for one revolution
// 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);
}