: arduinoioaddons.adafruit.stepper

Stepper class for stepper control on the adafruit motor shield

See also: arduinoioaddons.adafruit.motorshieldv2.

Properties

RPM

The rpm value set for the stepper motor

StepType

the StepType for the stepper (string) which can be "single", "double", "interleave" or "microstep"

StepsPerRevolution

the StepsPerRevoluion for the stepper (read only)

MotorNumber

the motor number for the stepper (read only) value will be 1 or 2.

Parent

the parent shield of this stepper (read only)

Methods

: obj = stepper(mObj, mnum, stepsperrev)
: obj = stepper(mObj, mnum, stepsperrev, propertyname, propertyvalue ....)

Constructor to create dcmotor object

Inputs

mObj - the motor shield object

mnum - The motor number (1 or 2)

stepsperrev - Number of steps per revolution.

propertyname, propertyvalue - Optional property name/value pairs to pass to motor object.

Current known properties are:

RPM

the RPM for the stepper (revolutions per minute)

StepType

the StepType for the stepper (string) which can be "single", "double", "interleave" or "microstep"

Outputs

s - a stepper object

Example


a = arduino()
ms = addon(a, "adafruit/motorshieldv2")
mtr = stepper(ms, 1, 200)

: move(sObj, steps)

Move the motor moving in the specified steps using the configured RPM.

Inputs

sObj - the stepper object

Outputs

None

See also: adafruit.motorshieldv2.

: release(sObj)

Release this motor

Inputs

sObj - the stepper object

Outputs

None

See also: adafruit.motorshieldv2.

Package: arduino