Package org.wpilib.commands3.button
Class InternalButton
java.lang.Object
org.wpilib.commands3.Trigger
org.wpilib.commands3.button.InternalButton
- All Implemented Interfaces:
BooleanSupplier
This class is intended to be used within a program. The programmer can manually set its value.
Also includes a setting for whether it should invert its value.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an InternalButton that is not inverted.InternalButton(boolean inverted) Creates an InternalButton which is inverted depending on the input. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetInverted(boolean inverted) Sets whether to invert button state.voidsetPressed(boolean pressed) Sets whether button is pressed.Methods inherited from class org.wpilib.commands3.Trigger
and, debounce, debounce, getAsBoolean, negate, onFalse, onTrue, or, toggleOnFalse, toggleOnTrue, whileFalse, whileTrue
-
Constructor Details
-
InternalButton
public InternalButton()Creates an InternalButton that is not inverted. -
InternalButton
Creates an InternalButton which is inverted depending on the input.- Parameters:
inverted- if false, then this button is pressed when set to true, otherwise it is pressed when set to false.
-
-
Method Details
-
setInverted
Sets whether to invert button state.- Parameters:
inverted- Whether button state should be inverted.
-
setPressed
Sets whether button is pressed.- Parameters:
pressed- Whether button is pressed.
-