A4988Stepper - README
Contents:
1. Summary
This library allows Arduino boards to control stepper motors with the A4988 driver board.Developed by Jens Ostertag, © 2020.
2. Commands
Setting up the stepper motor
At first, you have to set up the stepper motor by writingStepper stepper(direction, step, enable, stepsPerRevolution);
. The variables direction
, step
and enable
are the corresponding pins of the driver board. Their data type is integer.The variable
stepsPerRevolution
is the number of steps per revolution.
Second, you have to set the mentioned pins as OUTPUTs. You can either do this manually or by calling the method stepper.begin();
.
Enabling and disabling the motor
To enable the motor, you have to callstepper.enableMotor();
.To disable the motor, you have to call
stepper.disableMotor();
.
Driving the motor
To drive motor, you have to callstepper.driveMotor(invert, speed, steps)
. invert
is a boolean, that determines the rotation direction of the motor. If it is set to false, the motor will rotate clockwise, if it is defined as true, the motor spins counter-clockwise. speed
and steps
both are integers, with speed
you can specify the rotation speed and with steps
you can set the amount of steps the motor will turn.
3. Known bugs
- There are no known bugs