Adafruit Motor Shield V2 Arduino Library
Public Member Functions | Friends | List of all members
Adafruit_StepperMotor Class Reference

#include <Adafruit_MotorShield.h>

Public Member Functions

 Adafruit_StepperMotor (void)
 Create a StepperMotor object, un-initialized! You should never call this, instead have the Adafruit_MotorShield give you a StepperMotor object with Adafruit_MotorShield.getStepper.
 
void setSpeed (uint16_t)
 Set the delay for the Stepper Motor speed in RPM. More...
 
void step (uint16_t steps, uint8_t dir, uint8_t style=SINGLE)
 Move the stepper motor with the given RPM speed, don't forget to call Adafruit_StepperMotor.setSpeed to set the speed! More...
 
uint8_t onestep (uint8_t dir, uint8_t style)
 Move the stepper motor one step only, with no delays. More...
 
void release (void)
 Release all pins of the stepper motor so it free-spins.
 

Friends

class Adafruit_MotorShield
 Let MotorShield create StepperMotors.
 

Detailed Description

Object that controls and keeps state for a single stepper motor

Member Function Documentation

◆ setSpeed()

void Adafruit_StepperMotor::setSpeed ( uint16_t  rpm)

Set the delay for the Stepper Motor speed in RPM.

Parameters
rpmThe desired RPM, we will do our best to reach it!

◆ step()

void Adafruit_StepperMotor::step ( uint16_t  steps,
uint8_t  dir,
uint8_t  style = SINGLE 
)

Move the stepper motor with the given RPM speed, don't forget to call Adafruit_StepperMotor.setSpeed to set the speed!

Parameters
stepsThe number of steps we want to move
dirThe direction to go, can be FORWARD or BACKWARD
styleHow to perform each step, can be SINGLE, DOUBLE, INTERLEAVE or MICROSTEP

◆ onestep()

uint8_t Adafruit_StepperMotor::onestep ( uint8_t  dir,
uint8_t  style 
)

Move the stepper motor one step only, with no delays.

Parameters
dirThe direction to go, can be FORWARD or BACKWARD
styleHow to perform each step, can be SINGLE, DOUBLE, INTERLEAVE or MICROSTEP
Returns
The current step/microstep index, useful for Adafruit_StepperMotor.step to keep track of the current location, especially when microstepping

The documentation for this class was generated from the following files: