Class AsyncStepper

  • All Implemented Interfaces:
    crackers.kobots.parts.movement.async.AsyncActuator

    
    public class AsyncStepper
     implements AsyncActuator
                        

    Wraps up a stepper motor for asynchronous movement handling. This utilizes "step-counting" to do the actual movements.

    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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final Integer current
      private final BasicStepperController.StepStyle stepStyle
    • Constructor Summary

      Constructors 
      Constructor Description
      AsyncStepper(BasicStepperMotor theStepper, BasicStepperController.StepStyle stepStyle, Duration stepPause)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Integer getCurrent() Return some notion of the "current" position/value of the actuator.
      final BasicStepperController.StepStyle getStepStyle()
      final <Error class: unknown class> moveSteps(Integer steps, Duration elapsedTime, Function1<Float, Float> easingFunction)
      <Error class: unknown class> softLanding(Integer target, Duration time)
      <Error class: unknown class> softLaunch(Integer target, Duration time)
      <Error class: unknown class> smoothMove(Integer target, Duration time)
      Unit release() Release the stepper motor, allowing it to be turned freely.
      • 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

      • AsyncStepper

        AsyncStepper(BasicStepperMotor theStepper, BasicStepperController.StepStyle stepStyle, Duration stepPause)
        Parameters:
        theStepper - The underlying stepper motor to control.
        stepStyle - The stepping style to use (default: BasicStepperController.StepStyle.SINGLE).
        stepPause - The pause duration between steps (default: Duration.ZERO).