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 Detail

      • WsJoystickToggleButton

        public WsJoystickToggleButton​(java.lang.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 Detail

      • 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.