Class AsyncStepperRotator
-
- All Implemented Interfaces:
-
crackers.kobots.parts.movement.async.AsyncActuator,crackers.kobots.parts.movement.async.AsyncRotator
public class AsyncStepperRotator implements AsyncRotator
An asynchronous stepper rotator that smoothly rotates a stepper motor to a specified angle using easing functions.
This is built on top of BasicStepperRotator to provide asynchronous movement capabilities. The stepPause parameter is provided to introduce a delay between steps to prevent overdriving the stepper motor or driver circuits (e.g. "slow" response from the hardware).
NOTE The stepper is not automatically released after movement; it is assumed that holding torque is desired.
-
-
Field Summary
Fields Modifier and Type Field Description private final BasicStepperRotatorwrappedprivate final Integercurrentprivate final BasicStepperMotortheStepper
-
Constructor Summary
Constructors Constructor Description AsyncStepperRotator(BasicStepperMotor theStepper, Float gearRatio, Boolean reversed, BasicStepperController.StepStyle stepStyle, Duration stepPause)
-
Method Summary
Modifier and Type Method Description final BasicStepperRotatorgetWrapped()IntegergetCurrent()Return some notion of the "current" position/value of the actuator. final BasicStepperMotorgetTheStepper()<Error class: unknown class>rotateAsync(Integer angle, Duration time, Function1<Float, Float> easing)The basic asynchronous rotation function. Unitrelease()Release the stepper motor, allowing it to be turned freely. -
Methods inherited from class crackers.kobots.parts.movement.async.AsyncRotator
smoothMove, softLanding, softLaunch -
Methods inherited from class crackers.kobots.parts.movement.async.AsyncActuator
myLittleKillSwitch, stopCheck -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AsyncStepperRotator
AsyncStepperRotator(BasicStepperMotor theStepper, Float gearRatio, Boolean reversed, BasicStepperController.StepStyle stepStyle, Duration stepPause)
- Parameters:
theStepper- The stepper motor to be controlled.gearRatio- The gear ratio of the stepper motor.reversed- Whether the stepper motor direction is reversed.stepStyle- The stepping style to use for the stepper motor.stepPause- The pause duration between steps (default is 0).
-
-
Method Detail
-
getWrapped
final BasicStepperRotator getWrapped()
-
getCurrent
Integer getCurrent()
Return some notion of the "current" position/value of the actuator.
-
getTheStepper
final BasicStepperMotor getTheStepper()
-
rotateAsync
<Error class: unknown class> rotateAsync(Integer angle, Duration time, Function1<Float, Float> easing)
The basic asynchronous rotation function. It is "device dependent", which means accuracy may be suspect.
-
-
-
-