CommandGamepad
- class commands2.button.CommandGamepad(hid: int | Gamepad)[source]
Bases:
objectA version of
wpilib.GamepadwithTriggerfactories for command-based.Construct an instance of a controller.
- Parameters:
hid – The port index on the Driver Station that the controller is plugged into, or the Gamepad object to use for this controller.
- button(button, loop: EventLoop | None = None) Trigger[source]
Constructs an event instance around this button’s digital signal.
- Parameters:
button – the button index or
wpilib.Gamepad.Buttonloop – the event loop instance to attach the event to
- get_axis(axis) float[source]
Get the value of the axis.
- Parameters:
axis – the axis index or
wpilib.Gamepad.Axis
- get_gamepad() Gamepad[source]
Get the underlying Gamepad object.
- Returns:
the wrapped Gamepad object
- get_hid() CommandGenericHID[source]
Get the underlying CommandGenericHID object.
- Returns:
the wrapped CommandGenericHID object