Stepper( int number_of_steps, int motor_pin_1, int motor_pin_2 );
Stepper( int number_of_steps, int motor_pin_1, int motor_pin_2 );
Creates a new stepper instance to represent a particular stepper motor. The number of parameters is decided by the design of the stepper motor; 2 and 4 pins are supported.
|
Parameters |
Description |
|
int number_of_steps |
Number of steps of the current stepper motor. If your motor provides degree per step, divide 360 degree by the degree per step to get the total number of steps. |
|
int motor_pin_1 |
The pin bound to stepper motor (int). |
|
int motor_pin_2 |
The pin bound to stepper motor (int). |
None.
Stepper myStepper(100, 5, 6); // For 2 pins stepper with 100 steps that's connected to pin D5 and D6. Stepper myStepper(100, 5, 6, 7, 8); // For 4 pins stepper with 100 steps that's connected to pin D5, D6, D7 and D8.
Stepper.h