Class WsJoystickToggleButton


public class WsJoystickToggleButton extends DigitalInput
Reads a toggle joystick button. A joystick button whose output TOGGLES between true and false with each button press.
  • Constructor Details

    • WsJoystickToggleButton

      public WsJoystickToggleButton(String p_name, int p_port, int p_buttonIndex, boolean p_initialState)
      Construct the axis
      Parameters:
      p_name - Descriptive name of the button.
      p_port - Controller port as defined in the driver station.
      p_buttonIndex - Controller button index.
      p_initialState - Initial state the toggle should start in.
  • Method Details

    • readRawValue

      protected boolean readRawValue()
      Returns a toggled value each time the button is pressed.
      Specified by:
      readRawValue in class DigitalInput
      Returns:
      Toggled button value.
    • resetState

      public void resetState()
      Sets the toggle state back to the start state.