Im doin a project in college and it is my first time using Arduino code so im a bit confused. does anyone know what this stepper.h means. I have code to turn a stepper motor clockwise one revolution and counter closkwise one revolution but I cant describe what the stepsPerRevolution command means or what it is doing. I thought I had to have the direction pin on my driver board which is a 5804 unipolar driver high to turn the motor one way and low to turn it the other way, but as there is only 4 input connections to the driver board ( h-step, dir, s-inp and one phase) and in the code there is 4 pins from the arduino being used i dont understand how this code is driving the motor correctly. below is the code
#include <Stepper.h>
const int stepsPerRevolution = 850; // 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);
}