: arduinoioaddons.SimpleStepper

Stepper class for stepper control using ULN2003 and compatible drivers

Properties

Id

Id of the stepper (Read only)

Speed

Number of steps to do per second.

Status

Status of stepper (Read only). 0 = not moving, 1 = moving, 2 = rotating

Parent

the Arduino parent (read only)

Pins

the pins used for the stepper (read only)

Methods

: obj = SimpleStepper(aObj, pin1, pin2, pin3, pin4)
: obj = SimpleStepper(aObj, pin1, pin2, pin3, pin4, pin5)

Constructor to create a stepper object

Inputs

aObj - The arduino

pin1 - The first pin of the controller

pin2 - The second pin of the controller

pin3 - The third pin of the controller

pin4 - The fourth pin of the controller

pin5 - The fifth pin of the controller

Outputs

s - a simplestepper object

Example


a = arduino()
# create stepper object
s = addon(a, "simplestepper/simplestepper", "d2", "d3", "d4", "d5")
# start rotating left
s.rotate(-1);

See also: addon.

: move(sObj, steps)

Move the motor the specified number of steps using the configured Speed.

Inputs

sObj - the stepper object

steps - the number of steps to move. steps less than 0 will be moving left.

Outputs

None

See also: rotate.

: rotate(sObj, dir)

Start steppermotor moving in the specified direction using the configured Speed.

Inputs

sObj - the stepper object

dir - Direction to move. -1 = left, 0 = stop, 1 = right.

Outputs

None

See also: move.

: release(sObj)

Release this stepper motor

Inputs

sObj - the stepper object

Outputs

None

Package: arduino