Syntax
Stepper(
    int number_of_steps, 
    int motor_pin_1, 
    int motor_pin_2, 
    int motor_pin_3, 
    int motor_pin_4
);
ContentsIndex
PreviousUpNext
Stepper::Stepper Constructor (int, int, int, int, int)
Stepper Class | Example
Syntax
Stepper(
    int number_of_steps, 
    int motor_pin_1, 
    int motor_pin_2, 
    int motor_pin_3, 
    int motor_pin_4
);
Description

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
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 
Pin bound to stepper motor (int). 
int motor_pin_2 
Pin bound to stepper motor (int). 
int motor_pin_3 
Optional, for 4+1 stepper only (int). 
int motor_pin_4 
Optional, for 4+1 stepper only (int). 
Returns

None.

Example
Stepper myStepper(100, 5, 6);       // For 2 wire pins stepper with 100 steps that's connected to pin D5 and D6.
Stepper myStepper(100, 5, 6, 7, 8); // For 4 wire pins stepper with 100 steps that's connected to pin D5, D6, D7 and D8.
File

Stepper.h

Class