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 Integer
getCurrent()
final BasicStepperMotor
getTheStepper()
final Integer
getMaxSteps()
final Boolean
getReversed()
final BasicStepperController.StepStyle
getStepStyle()
Boolean
extendTo(Integer percentage)
Extend or retract the actuator to the given percentage of the total range of motion. Unit
release()
Release the stepper: this is to prevent over-heating Unit
reset()
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
true
if the target has been reached.
-
-
-
-