Class POVButton
java.lang.Object
edu.wpi.first.wpilibj2.command.button.Trigger
edu.wpi.first.wpilibj2.command.button.Button
edu.wpi.first.wpilibj2.command.button.POVButton
- All Implemented Interfaces:
BooleanSupplier
public class POVButton extends Button
A
Button
that gets its state from a POV on a GenericHID
.-
Constructor Summary
Constructors Constructor Description POVButton(GenericHID joystick, int angle)
Creates a POV button for triggering commands.POVButton(GenericHID joystick, int angle, int povNumber)
Creates a POV button for triggering commands. -
Method Summary
Modifier and Type Method Description boolean
get()
Checks whether the current value of the POV is the target angle.Methods inherited from class edu.wpi.first.wpilibj2.command.button.Button
cancelWhenPressed, toggleWhenPressed, toggleWhenPressed, whenHeld, whenHeld, whenPressed, whenPressed, whenPressed, whenReleased, whenReleased, whenReleased, whileHeld, whileHeld, whileHeld
Methods inherited from class edu.wpi.first.wpilibj2.command.button.Trigger
and, cancelWhenActive, debounce, debounce, getAsBoolean, negate, or, toggleWhenActive, toggleWhenActive, whenActive, whenActive, whenActive, whenInactive, whenInactive, whenInactive, whileActiveContinuous, whileActiveContinuous, whileActiveContinuous, whileActiveOnce, whileActiveOnce
-
Constructor Details
-
POVButton
Creates a POV button for triggering commands.- Parameters:
joystick
- The GenericHID object that has the POVangle
- The desired angle in degrees (e.g. 90, 270)povNumber
- The POV number (seeGenericHID.getPOV(int)
)
-
POVButton
Creates a POV button for triggering commands. By default, acts on POV 0- Parameters:
joystick
- The GenericHID object that has the POVangle
- The desired angle (e.g. 90, 270)
-
-
Method Details