Class WsJoystickToggleButton
- java.lang.Object
-
- org.wildstang.framework.io.inputs.Input
-
- org.wildstang.framework.io.inputs.DigitalInput
-
- org.wildstang.hardware.roborio.inputs.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 Summary
Constructors Constructor Description WsJoystickToggleButton(java.lang.String p_name, int p_port, int p_buttonIndex, boolean p_initialState)
Construct the axis
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
readRawValue()
Returns a toggled value each time the button is pressed.void
resetState()
Sets the toggle state back to the start state.-
Methods inherited from class org.wildstang.framework.io.inputs.DigitalInput
getValue, readDataFromInput, setValue
-
Methods inherited from class org.wildstang.framework.io.inputs.Input
addInputListener, disable, enable, getInputListeners, getName, hasValueChanged, isEnabled, notifyListeners, removeAllListeners, removeInputListener, setValueChanged, update
-
-
-
-
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 classDigitalInput
- Returns:
- Toggled button value.
-
resetState
public void resetState()
Sets the toggle state back to the start state.
-
-