Class CommandSwitchN64Controller
java.lang.Object
org.wpilib.command3.button.CommandSwitchN64Controller
A version of
SwitchN64Controller with Trigger factories for command-based.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCommandSwitchN64Controller(int port) Construct an instance of a controller.CommandSwitchN64Controller(Scheduler scheduler, int port) Construct an instance of a controller.CommandSwitchN64Controller(Scheduler scheduler, SwitchN64Controller controller) Construct an instance of a controller.CommandSwitchN64Controller(SwitchN64Controller controller) Construct an instance of a controller. -
Method Summary
Modifier and TypeMethodDescriptiona()Constructs a Trigger instance around the A button's digital signal.Constructs a Trigger instance around the A button's digital signal.b()Constructs a Trigger instance around the B button's digital signal.Constructs a Trigger instance around the B button's digital signal.capture()Constructs a Trigger instance around the Capture button's digital signal.Constructs a Trigger instance around the Capture button's digital signal.CDown()Constructs a Trigger instance around the C Down button's digital signal.Constructs a Trigger instance around the C Down button's digital signal.CLeft()Constructs a Trigger instance around the C Left button's digital signal.Constructs a Trigger instance around the C Left button's digital signal.CRight()Constructs a Trigger instance around the C Right button's digital signal.Constructs a Trigger instance around the C Right button's digital signal.CUp()Constructs a Trigger instance around the C Up button's digital signal.Constructs a Trigger instance around the C Up button's digital signal.dpadDown()Constructs a Trigger instance around the Dpad Down button's digital signal.Constructs a Trigger instance around the Dpad Down button's digital signal.dpadLeft()Constructs a Trigger instance around the Dpad Left button's digital signal.Constructs a Trigger instance around the Dpad Left button's digital signal.Constructs a Trigger instance around the Dpad Right button's digital signal.Constructs a Trigger instance around the Dpad Right button's digital signal.dpadUp()Constructs a Trigger instance around the Dpad Up button's digital signal.Constructs a Trigger instance around the Dpad Up button's digital signal.Get the wrapped controller object.getHID()Get the underlying CommandGenericHID object.doublegetLeftX()Get the Left X value of the controller.doublegetLeftY()Get the Left Y value of the controller.doublegetZAxis()Get the Z Axis value of the controller.doublegetZR()Get the ZR value of the controller.home()Constructs a Trigger instance around the Home button's digital signal.Constructs a Trigger instance around the Home button's digital signal.L()Constructs a Trigger instance around the L button's digital signal.Constructs a Trigger instance around the L button's digital signal.R()Constructs a Trigger instance around the R button's digital signal.Constructs a Trigger instance around the R button's digital signal.start()Constructs a Trigger instance around the Start button's digital signal.Constructs a Trigger instance around the Start button's digital signal.ZR()Constructs a Trigger instance around the axis value of the ZR.ZR(double threshold) Constructs a Trigger instance around the axis value of the ZR.Constructs a Trigger instance around the axis value of the ZR.
-
Constructor Details
-
CommandSwitchN64Controller
public CommandSwitchN64Controller(int port) Construct an instance of a controller. Commands bound to buttons on the controller will be scheduled on thedefault schedulerusing its default event loop.- Parameters:
port- The port index on the Driver Station that the controller is plugged into.
-
CommandSwitchN64Controller
Construct an instance of a controller. Commands bound to buttons on the controller will be scheduled on thedefault schedulerusing its default event loop.- Parameters:
controller- The SwitchN64Controller object to use for this controller.
-
CommandSwitchN64Controller
Construct an instance of a controller. Commands bound to buttons on the controller will be scheduled on the given scheduler using its default event loop.- Parameters:
scheduler- The scheduler that should execute the triggered commands.port- The port index on the Driver Station that the controller is plugged into.
-
CommandSwitchN64Controller
Construct an instance of a controller. Commands bound to buttons on the controller will be scheduled on the given scheduler using its default event loop.- Parameters:
scheduler- The scheduler that should execute the triggered commands.controller- The SwitchN64Controller object to use for this controller.
-
-
Method Details
-
getHID
Get the underlying CommandGenericHID object.- Returns:
- the wrapped CommandGenericHID object
-
getController
Get the wrapped controller object.- Returns:
- the wrapped controller object
-
a
Constructs a Trigger instance around the A button's digital signal.- Returns:
- a Trigger instance representing the A button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
a
-
b
Constructs a Trigger instance around the B button's digital signal.- Returns:
- a Trigger instance representing the B button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
b
-
CLeft
Constructs a Trigger instance around the C Left button's digital signal.- Returns:
- a Trigger instance representing the C Left button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
CLeft
-
CUp
Constructs a Trigger instance around the C Up button's digital signal.- Returns:
- a Trigger instance representing the C Up button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
CUp
-
capture
Constructs a Trigger instance around the Capture button's digital signal.- Returns:
- a Trigger instance representing the Capture button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
capture
-
home
Constructs a Trigger instance around the Home button's digital signal.- Returns:
- a Trigger instance representing the Home button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
home
-
start
Constructs a Trigger instance around the Start button's digital signal.- Returns:
- a Trigger instance representing the Start button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
start
-
CDown
Constructs a Trigger instance around the C Down button's digital signal.- Returns:
- a Trigger instance representing the C Down button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
CDown
-
L
Constructs a Trigger instance around the L button's digital signal.- Returns:
- a Trigger instance representing the L button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
L
-
R
Constructs a Trigger instance around the R button's digital signal.- Returns:
- a Trigger instance representing the R button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
R
-
dpadUp
Constructs a Trigger instance around the Dpad Up button's digital signal.- Returns:
- a Trigger instance representing the Dpad Up button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
dpadUp
-
dpadDown
Constructs a Trigger instance around the Dpad Down button's digital signal.- Returns:
- a Trigger instance representing the Dpad Down button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
dpadDown
-
dpadLeft
Constructs a Trigger instance around the Dpad Left button's digital signal.- Returns:
- a Trigger instance representing the Dpad Left button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
dpadLeft
-
dpadRight
Constructs a Trigger instance around the Dpad Right button's digital signal.- Returns:
- a Trigger instance representing the Dpad Right button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
dpadRight
-
CRight
Constructs a Trigger instance around the C Right button's digital signal.- Returns:
- a Trigger instance representing the C Right button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
CRight
-
ZR
Constructs a Trigger instance around the axis value of the ZR. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.loop- the event loop instance to attach the Trigger to.- Returns:
- a Trigger instance that is true when the ZR axis exceeds the provided threshold, attached to the given event loop
-
ZR
Constructs a Trigger instance around the axis value of the ZR. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.- Returns:
- a Trigger instance that is true when the ZR axis exceeds the provided
threshold, attached to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided.
-
ZR
Constructs a Trigger instance around the axis value of the ZR. The returned trigger will be true when the axis value is greater than 0.5.- Returns:
- a Trigger instance that is true when the ZR axis exceeds 0.5, attached to
the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided.
-
getLeftX
public double getLeftX()Get the Left X value of the controller.- Returns:
- The axis value.
-
getLeftY
public double getLeftY()Get the Left Y value of the controller.- Returns:
- The axis value.
-
getZAxis
public double getZAxis()Get the Z Axis value of the controller.- Returns:
- The axis value.
-
getZR
public double getZR()Get the ZR value of the controller.- Returns:
- The axis value.
-