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.

    • 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
      BasicStepperRotator(BasicStepperMotor theStepper, Float gearRatio, Boolean reversed, BasicStepperController.StepStyle stepStyle, Integer stepsPerRotation)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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.
      • Methods inherited from class crackers.kobots.parts.movement.Rotator

        move
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BasicStepperRotator

        BasicStepperRotator(BasicStepperMotor theStepper, Float gearRatio, Boolean reversed, BasicStepperController.StepStyle stepStyle, Integer stepsPerRotation)
    • Method Detail

      • getStepStyle

         final BasicStepperController.StepStyle getStepStyle()
      • release

         Unit release()

        Pass through to release the stepper when it's not directly available.

      • rotateTo

         Boolean rotateTo(Integer angle)

        Take a "step" towards this destination. Returns true if the target has been reached.

      • reset

         Unit reset()

        Allows for "re-calibration" of the stepper to the "0" position.