Class POVToJoystick

java.lang.Object
edu.wpi.first.wpilibj2.command.button.Trigger
ca.team4308.absolutelib.control.POVToJoystick
All Implemented Interfaces:
BooleanSupplier

public class POVToJoystick extends Trigger
A Trigger whose state is based on a POV (D-pad) angle from a GenericHID.

The trigger is active when GenericHID.getPOV(int) for the configured POV index returns the specified angle.

  • Constructor Details

    • POVToJoystick

      public POVToJoystick(GenericHID joystick, int angle, int povNumber)
      Creates a joystick POV "button" for triggering commands.
      Parameters:
      joystick - The GenericHID object that has the POV (e.g. Joystick)
      angle - The POV angle being matched (e.g. 0, 90, 180, 270)
      povNumber - The POV index (usually 0). Previous comment referenced buttonNumber; kept for compatibility. Implementation note: - The lambda checks joystick.getPOV(povNumber) == angle. - Null validation runs after super(); safe in normal usage but could be moved earlier.
    • POVToJoystick

      public POVToJoystick(GenericHID joystick, int angle)
      Creates a POV trigger for POV index 0.
      Parameters:
      joystick - The GenericHID object that has the POV
      angle - Desired POV angle