In this file is described how to use the library and all its functions.
To import the library:
#include <Step_er.h>
Initialize the Step_er class:
Step_er mystepper(_mode_);
The mode has to be choosed between STEP_DRIVE, FULL_STEP, HALF_STEP (read more in the motor doc Stepping mode).
Initialize the stepper motor:
void setup() {
mystepper.attach(_IN1, _IN2, _IN3, _IN4);
}
_IN1, _IN2, _IN3, _IN4 are the pin where the ULN2003 driver is atthacched to.
There are different function to turn the motor:
In all function _direction is a boolean
, and is referred to the direction of the movement True=clockwise or False=anticlockwise.
-
Turn by steps:
mystepper.step_move(_steps, _direction);
_steps is an
int
, and is referred to the number of steps to move by; -
Turn by angle:
mystepper.ang_move(_angle, _direction);
_angle is a
float
, and is referred to the angle to move by; -
Turn by revolutions:
mystepper.turn(_revolution, _direction);
_revolutions is an
int
, and is referred to the number of revolutions (full turn of 360°) to move by; -
Turn by a single step:
mystepper.one(_direction);
This function allow to move by a single step without calling the
.step_move
method.
This library contain also other special function.
- Reset Until Button is Pressed:
_ButtonPin is an
mystepper.resetTo(_ButtonPin, _direction);
int
, and is referred to the pin where the button is attached. this function is mentioned in an example of the library ResetToButton and the schematic can be found in the images folder of the library or in the ReadMe.
Read the documentation of the motor at []