Package frc.robot.input
Class AutoInput
java.lang.Object
frc.robot.input.Input
frc.robot.input.AutoInput
-
Nested Class Summary
Nested classes/interfaces inherited from class frc.robot.input.Input
Input.BooleanEventType -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an AutonInput to store input from commands for the FSMs. -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets the axis value for a specific axis.protected Function<edu.wpi.first.wpilibj.event.EventLoop,edu.wpi.first.wpilibj.event.BooleanEvent> edu.wpi.first.wpilibj2.command.CommandReturns an instant command that briefly presses a button.edu.wpi.first.wpilibj2.command.CommandpressButtonCommand(InputTypes.ButtonInput button, int duration) Returns an instant command that briefly presses a button.voidsetAxis(InputTypes.AxialInput axis, double value) Setter for an axis value.voidsetButton(InputTypes.ButtonInput button, boolean value) Setter for a button value.edu.wpi.first.wpilibj2.command.CommandReturns an instant command that toggles the button value.Methods inherited from class frc.robot.input.Input
getBooleanEvent, getButtonPressed, getButtonReleased, getButtonValue, reset, update
-
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
Setter for a button value.- Parameters:
button- the buttonvalue- the value
-
toggleButtonCommand
Returns an instant command that toggles the button value.- Parameters:
button- the button to toggle- Returns:
- the command
-
pressButtonCommand
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 pressduration- the duration of the press in seconds- Returns:
- the command
-
setAxis
Setter for an axis value.- Parameters:
axis- the axisvalue- the value
-
getAxisValue
Description copied from class:InputGets the axis value for a specific axis.- Specified by:
getAxisValuein classInput- 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)
-