Package crackers.kobots.parts.movement
Class BasicStepperRotator
-
- All Implemented Interfaces:
-
crackers.kobots.parts.movement.Actuator
,crackers.kobots.parts.movement.StepperActuator
public class BasicStepperRotator extends Rotator implements StepperActuator
Stepper motor with an optional gear ratio. If reversed is
true
, the motor is mounted "backwards" relative to desired rotation. Each movement is executed as a single step of the motor.NOTE The accuracy of the movement is dependent on rounding errors in the calculation of the number of steps required to reach the destination. The timing of each step may also affect if the motor receives the pulse or not. The intent of this device is to be repeatable.
theStepper should be "released" after use to avoid motor burnout and to allow for "re-calibration" if necessary.
-
-
Constructor Summary
Constructors Constructor Description BasicStepperRotator(BasicStepperMotor theStepper, Float gearRatio, Boolean reversed, BasicStepperController.StepStyle stepStyle, Integer stepsPerRotation)
-
Method Summary
Modifier and Type Method Description Integer
getCurrent()
final BasicStepperController.StepStyle
getStepStyle()
Unit
release()
Pass through to release the stepper when it's not directly available. Boolean
rotateTo(Integer angle)
Take a "step" towards this destination. Unit
reset()
Allows for "re-calibration" of the stepper to the "0" position. -
-
Method Detail
-
getCurrent
Integer getCurrent()
-
getStepStyle
final BasicStepperController.StepStyle getStepStyle()
-
rotateTo
Boolean rotateTo(Integer angle)
Take a "step" towards this destination. Returns
true
if the target has been reached.
-
-
-
-