Class AutoInput

java.lang.Object
frc.robot.input.Input
frc.robot.input.AutoInput

public final class AutoInput extends Input
  • Field Details

    • DEFAULT_PRESS_DURATION_CYCLES

      public static final int DEFAULT_PRESS_DURATION_CYCLES
      See Also:
  • Constructor Details

    • AutoInput

      public AutoInput()
      Constructs an AutonInput to store input from commands for the FSMs. Uses wpi event loops to handle pressed / released / raw behavior.
  • Method Details

    • setButton

      public void setButton(InputTypes.ButtonInput button, boolean value)
      Setter for a button value.
      Parameters:
      button - the button
      value - the value
    • toggleButtonCommand

      public edu.wpi.first.wpilibj2.command.Command toggleButtonCommand(InputTypes.ButtonInput button)
      Returns an instant command that toggles the button value.
      Parameters:
      button - the button to toggle
      Returns:
      the command
    • pressButtonCommand

      public edu.wpi.first.wpilibj2.command.Command pressButtonCommand(InputTypes.ButtonInput button)
      Returns an instant command that briefly presses a button.
      Parameters:
      button - the button to press
      Returns:
      the command
    • pressButtonCommand

      public edu.wpi.first.wpilibj2.command.Command pressButtonCommand(InputTypes.ButtonInput button, int duration)
      Returns an instant command that briefly presses a button.
      Parameters:
      button - the button to press
      duration - the duration of the press in seconds
      Returns:
      the command
    • setAxis

      public void setAxis(InputTypes.AxialInput axis, double value)
      Setter for an axis value.
      Parameters:
      axis - the axis
      value - the value
    • getAxisValue

      public double getAxisValue(InputTypes.AxialInput key)
      Description copied from class: Input
      Gets the axis value for a specific axis.
      Specified by:
      getAxisValue in class Input
      Parameters:
      key - the axis identifier
      Returns:
      the axis value
    • getButton

      protected Function<edu.wpi.first.wpilibj.event.EventLoop,edu.wpi.first.wpilibj.event.BooleanEvent> getButton(InputTypes.ButtonInput key)
      Specified by:
      getButton in class Input