LogitechF310Controller
- class wpilib.LogitechF310Controller(*args, **kwargs)
-
Handle input from LogitechF310 controllers connected to the Driver Station.
This class handles LogitechF310 input that comes from the Driver Station. Each time a value is requested the most recent value is returned.
Overloaded function.
__init__(self: wpilib._wpilib.LogitechF310Controller, port: typing.SupportsInt | typing.SupportsIndex) -> None
Construct an instance of a controller.
The controller index is the USB port on the Driver Station.
- Parameters:
port – The port on the Driver Station that the controller is plugged into.
__init__(self: wpilib._wpilib.LogitechF310Controller, hid: wpilib._wpilib.GenericHID) -> None
Construct an instance of a controller with a GenericHID object.
- Parameters:
hid – The GenericHID object to use for this controller.
- class Axis(value: SupportsInt | SupportsIndex)
Bases:
pybind11_objectRepresents an axis on a LogitechF310Controller.
Members:
LEFT_X : Left X.
LEFT_Y : Left Y.
RIGHT_X : Right X.
RIGHT_Y : Right Y.
LEFT_TRIGGER : Left Trigger.
RIGHT_TRIGGER : Right Trigger.
- LEFT_TRIGGER = <Axis.LEFT_TRIGGER: 4>
- LEFT_X = <Axis.LEFT_X: 0>
- LEFT_Y = <Axis.LEFT_Y: 1>
- RIGHT_TRIGGER = <Axis.RIGHT_TRIGGER: 5>
- RIGHT_X = <Axis.RIGHT_X: 2>
- RIGHT_Y = <Axis.RIGHT_Y: 3>
- LogitechF310Controller.Axis.name -> str
- property value
- class Button(value: SupportsInt | SupportsIndex)
Bases:
pybind11_objectRepresents a digital button on a LogitechF310Controller.
Members:
A : A button.
B : B button.
X : X button.
Y : Y button.
BACK : Back button.
LOGITECH : Logitech button.
START : Start button.
LEFT_STICK : Left Stick button.
RIGHT_STICK : Right Stick button.
LEFT_BUMPER : Left Bumper button.
RIGHT_BUMPER : Right Bumper button.
DPAD_UP : Dpad Up button.
DPAD_DOWN : Dpad Down button.
DPAD_LEFT : Dpad Left button.
DPAD_RIGHT : Dpad Right button.
- A = <Button.A: 0>
- B = <Button.B: 1>
- BACK = <Button.BACK: 4>
- DPAD_DOWN = <Button.DPAD_DOWN: 12>
- DPAD_LEFT = <Button.DPAD_LEFT: 13>
- DPAD_RIGHT = <Button.DPAD_RIGHT: 14>
- DPAD_UP = <Button.DPAD_UP: 11>
- LEFT_BUMPER = <Button.LEFT_BUMPER: 9>
- LEFT_STICK = <Button.LEFT_STICK: 7>
- LOGITECH = <Button.LOGITECH: 5>
- RIGHT_BUMPER = <Button.RIGHT_BUMPER: 10>
- RIGHT_STICK = <Button.RIGHT_STICK: 8>
- START = <Button.START: 6>
- X = <Button.X: 2>
- Y = <Button.Y: 3>
- LogitechF310Controller.Button.name -> str
- property value
- SUPPORTED_OUTPUTS = <SupportedOutputs.NONE: 0>
- SUPPORTS_MONO_LED = False
- SUPPORTS_RGB_LED = False
- SUPPORTS_RUMBLE = False
- SUPPORTS_TRIGGER_RUMBLE = False
- TOUCHPAD_COUNT = 0
- a(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the A button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the A button’s digital signal attached to the given loop.
- axis_greater_than(axis: wpilib._wpilib.LogitechF310Controller.Axis, threshold: SupportsFloat | SupportsIndex, loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance that is true when the axis value is greater than threshold.
- Parameters:
axis – The axis to read.
threshold – The value above which this event should return true.
loop – the event loop instance to attach the event to.
- Returns:
an event instance that is true when the axis value is greater than the provided threshold.
- axis_less_than(axis: wpilib._wpilib.LogitechF310Controller.Axis, threshold: SupportsFloat | SupportsIndex, loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance that is true when the axis value is less than threshold.
- Parameters:
axis – The axis to read.
threshold – The value below which this event should return true.
loop – the event loop instance to attach the event to.
- Returns:
an event instance that is true when the axis value is less than the provided threshold.
- b(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the B button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the B button’s digital signal attached to the given loop.
- back(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the Back button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the Back button’s digital signal attached to the given loop.
- button(button: wpilib._wpilib.LogitechF310Controller.Button, loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around this button’s digital signal.
- Parameters:
button – the button
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the button’s digital signal attached to the given loop.
- dpad_down(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the Dpad Down button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the Dpad Down button’s digital signal attached to the given loop.
- dpad_left(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the Dpad Left button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the Dpad Left button’s digital signal attached to the given loop.
- dpad_right(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the Dpad Right button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the Dpad Right button’s digital signal attached to the given loop.
- dpad_up(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the Dpad Up button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the Dpad Up button’s digital signal attached to the given loop.
- get_a_button() bool
Read the value of the A button on the controller.
- Returns:
The state of the button.
- get_a_button_pressed() bool
Whether the A button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_a_button_released() bool
Whether the A button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_axis(axis: wpilib._wpilib.LogitechF310Controller.Axis) float
Get the value of the axis.
- Parameters:
axis – The axis to read
- Returns:
the axis value.
- get_b_button() bool
Read the value of the B button on the controller.
- Returns:
The state of the button.
- get_b_button_pressed() bool
Whether the B button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_b_button_released() bool
Whether the B button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_back_button() bool
Read the value of the Back button on the controller.
- Returns:
The state of the button.
- get_back_button_pressed() bool
Whether the Back button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_back_button_released() bool
Whether the Back button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_button(button: wpilib._wpilib.LogitechF310Controller.Button) bool
Get the button value.
- Parameters:
button – The button to read
- Returns:
The state of the button.
- get_button_pressed(button: wpilib._wpilib.LogitechF310Controller.Button) bool
Whether the button was pressed since the last check.
- Parameters:
button – The button to read
- Returns:
Whether the button was pressed since the last check.
- get_button_released(button: wpilib._wpilib.LogitechF310Controller.Button) bool
Whether the button was released since the last check.
- Parameters:
button – The button to read
- Returns:
Whether the button was released since the last check.
- get_dpad_down_button() bool
Read the value of the Dpad Down button on the controller.
- Returns:
The state of the button.
- get_dpad_down_button_pressed() bool
Whether the Dpad Down button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_dpad_down_button_released() bool
Whether the Dpad Down button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_dpad_left_button() bool
Read the value of the Dpad Left button on the controller.
- Returns:
The state of the button.
- get_dpad_left_button_pressed() bool
Whether the Dpad Left button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_dpad_left_button_released() bool
Whether the Dpad Left button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_dpad_right_button() bool
Read the value of the Dpad Right button on the controller.
- Returns:
The state of the button.
- get_dpad_right_button_pressed() bool
Whether the Dpad Right button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_dpad_right_button_released() bool
Whether the Dpad Right button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_dpad_up_button() bool
Read the value of the Dpad Up button on the controller.
- Returns:
The state of the button.
- get_dpad_up_button_pressed() bool
Whether the Dpad Up button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_dpad_up_button_released() bool
Whether the Dpad Up button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_hid() wpilib._wpilib.GenericHID
Get the underlying GenericHID object.
- Returns:
the wrapped GenericHID object
- get_left_bumper_button() bool
Read the value of the Left Bumper button on the controller.
- Returns:
The state of the button.
- get_left_bumper_button_pressed() bool
Whether the Left Bumper button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_left_bumper_button_released() bool
Whether the Left Bumper button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_left_stick_button() bool
Read the value of the Left Stick button on the controller.
- Returns:
The state of the button.
- get_left_stick_button_pressed() bool
Whether the Left Stick button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_left_stick_button_released() bool
Whether the Left Stick button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_left_trigger() float
Get the Left Trigger value of the controller.
- Returns:
the axis value.
- get_left_x() float
Get the Left X value of the controller.
- Returns:
the axis value.
- get_left_y() float
Get the Left Y value of the controller.
- Returns:
the axis value.
- get_logitech_button() bool
Read the value of the Logitech button on the controller.
- Returns:
The state of the button.
- get_logitech_button_pressed() bool
Whether the Logitech button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_logitech_button_released() bool
Whether the Logitech button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_port() int
Get the port number of the HID.
- Returns:
The port number of the HID.
- get_right_bumper_button() bool
Read the value of the Right Bumper button on the controller.
- Returns:
The state of the button.
- get_right_bumper_button_pressed() bool
Whether the Right Bumper button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_right_bumper_button_released() bool
Whether the Right Bumper button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_right_stick_button() bool
Read the value of the Right Stick button on the controller.
- Returns:
The state of the button.
- get_right_stick_button_pressed() bool
Whether the Right Stick button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_right_stick_button_released() bool
Whether the Right Stick button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_right_trigger() float
Get the Right Trigger value of the controller.
- Returns:
the axis value.
- get_right_x() float
Get the Right X value of the controller.
- Returns:
the axis value.
- get_right_y() float
Get the Right Y value of the controller.
- Returns:
the axis value.
- get_start_button() bool
Read the value of the Start button on the controller.
- Returns:
The state of the button.
- get_start_button_pressed() bool
Whether the Start button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_start_button_released() bool
Whether the Start button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_x_button() bool
Read the value of the X button on the controller.
- Returns:
The state of the button.
- get_x_button_pressed() bool
Whether the X button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_x_button_released() bool
Whether the X button was released since the last check.
- Returns:
Whether the button was released since the last check.
- get_y_button() bool
Read the value of the Y button on the controller.
- Returns:
The state of the button.
- get_y_button_pressed() bool
Whether the Y button was pressed since the last check.
- Returns:
Whether the button was pressed since the last check.
- get_y_button_released() bool
Whether the Y button was released since the last check.
- Returns:
Whether the button was released since the last check.
- init_sendable(builder: wpiutil._wpiutil.SendableBuilder) None
- is_connected() bool
Get if the HID is connected.
- Returns:
true if the HID is connected
- left_bumper(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the Left Bumper button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the Left Bumper button’s digital signal attached to the given loop.
- left_stick(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the Left Stick button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the Left Stick button’s digital signal attached to the given loop.
- logitech(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the Logitech button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the Logitech button’s digital signal attached to the given loop.
- right_bumper(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the Right Bumper button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the Right Bumper button’s digital signal attached to the given loop.
- right_stick(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the Right Stick button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the Right Stick button’s digital signal attached to the given loop.
- set_leds(r: SupportsInt | SupportsIndex, g: SupportsInt | SupportsIndex, b: SupportsInt | SupportsIndex) None
Set leds on the controller.
- Parameters:
r – Red value from 0-255
g – Green value from 0-255
b – Blue value from 0-255
- set_rumble(type: wpilib._wpilib.GenericHID.RumbleType, value: SupportsFloat | SupportsIndex) None
Set the rumble output for the HID.
- Parameters:
type – Which rumble value to set
value – The normalized value (0 to 1) to set the rumble to
- start(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the Start button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the Start button’s digital signal attached to the given loop.
- x(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the X button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the X button’s digital signal attached to the given loop.
- y(loop: wpilib._wpilib.EventLoop) wpilib._wpilib.BooleanEvent
Constructs an event instance around the Y button’s digital signal.
- Parameters:
loop – the event loop instance to attach the event to.
- Returns:
an event instance representing the Y button’s digital signal attached to the given loop.