Class LimitedElevator

  • All Implemented Interfaces:
    Stoppable

    public class LimitedElevator
    extends java.lang.Object
    implements Stoppable
    An elevator with upper and/or lower limits.
    • Constructor Summary

      Constructors 
      Constructor Description
      LimitedElevator​(edu.wpi.first.wpilibj.SpeedController speedController, java.util.function.BooleanSupplier topLimit, java.util.function.BooleanSupplier bottomLimit)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void down​(double speed)
      Move the elevator down, stops at the bottom limit
      boolean isAtBottom()
      Determines if the elevator is at the bottom
      boolean isAtTop()
      Determines if the elevator is at the top
      void stop()
      Stop the mechanism from moving
      void up​(double speed)
      Move the elevator up, stops at the top limit
      • Methods inherited from class java.lang.Object

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

      • LimitedElevator

        public LimitedElevator​(edu.wpi.first.wpilibj.SpeedController speedController,
                               java.util.function.BooleanSupplier topLimit,
                               java.util.function.BooleanSupplier bottomLimit)
    • Method Detail

      • isAtTop

        public boolean isAtTop()
        Determines if the elevator is at the top
        Returns:
        True if it is at the top, false otherwise
      • isAtBottom

        public boolean isAtBottom()
        Determines if the elevator is at the bottom
        Returns:
        True if it is at the bottom, false otherwise
      • up

        public void up​(double speed)
        Move the elevator up, stops at the top limit
        Parameters:
        speed - the speed to move up
      • down

        public void down​(double speed)
        Move the elevator down, stops at the bottom limit
        Parameters:
        speed - the speed to move down
      • stop

        public void stop()
        Description copied from interface: Stoppable
        Stop the mechanism from moving
        Specified by:
        stop in interface Stoppable