Class POVButton

All Implemented Interfaces:
BooleanSupplier

public class POVButton
extends Button
A Button that gets its state from a POV on a GenericHID.
  • Constructor Details

    • POVButton

      public POVButton​(GenericHID joystick, int angle, int povNumber)
      Creates a POV button for triggering commands.
      Parameters:
      joystick - The GenericHID object that has the POV
      angle - The desired angle in degrees (e.g. 90, 270)
      povNumber - The POV number (see GenericHID.getPOV(int))
    • POVButton

      public POVButton​(GenericHID joystick, int angle)
      Creates a POV button for triggering commands. By default, acts on POV 0
      Parameters:
      joystick - The GenericHID object that has the POV
      angle - The desired angle (e.g. 90, 270)
  • Method Details

    • get

      public boolean get()
      Checks whether the current value of the POV is the target angle.
      Overrides:
      get in class Trigger
      Returns:
      Whether the value of the POV matches the target angle