Syntax
Stepper(
    int number_of_steps, 
    int motor_pin_1, 
    int motor_pin_2
);
ContentsIndex
PreviousUpNext
Stepper::Stepper Constructor (int, int, int)
Stepper Class | Example
Syntax
Stepper(
    int number_of_steps, 
    int motor_pin_1, 
    int motor_pin_2
);
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 
The pin bound to stepper motor (int). 
int motor_pin_2 
The pin bound to stepper motor (int). 
Returns

None.

Example
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.    
File

Stepper.h

Class