Package crackers.kobots.parts.movement
Class StepperLinearActuator
-
- All Implemented Interfaces:
-
crackers.kobots.parts.movement.Actuator,crackers.kobots.parts.movement.StepperActuator
public class StepperLinearActuator extends LinearActuator implements StepperActuator
An actuator that translates percentages into steps on a stepper motor. Note that due to rounding issues between these two integer values, the positioning is not guaranteed to be exact.
ONLY WORKS WITH SINGLE-STEP DRIVERS!
-
-
Constructor Summary
Constructors Constructor Description StepperLinearActuator(BasicStepperMotor theStepper, Integer maxSteps, Boolean reversed, BasicStepperController.StepStyle stepStyle)
-
Method Summary
Modifier and Type Method Description IntegergetCurrent()final BasicStepperMotorgetTheStepper()final IntegergetMaxSteps()final BooleangetReversed()final BasicStepperController.StepStylegetStepStyle()BooleanextendTo(Integer percentage)Extend or retract the actuator to the given percentage of the total range of motion. Unitrelease()Release the stepper: this is to prevent over-heating Unitreset()Allows for "re-calibration" of the stepper to the "0" position. -
-
Method Detail
-
getCurrent
Integer getCurrent()
-
getTheStepper
final BasicStepperMotor getTheStepper()
-
getMaxSteps
final Integer getMaxSteps()
-
getReversed
final Boolean getReversed()
-
getStepStyle
final BasicStepperController.StepStyle getStepStyle()
-
extendTo
Boolean extendTo(Integer percentage)
Extend or retract the actuator to the given percentage of the total range of motion. Returns
trueif the target has been reached.
-
-
-
-