StadiaController

class wpilib.StadiaController(port: int)

Bases: GenericHID

Handle input from Stadia controllers connected to the Driver Station.

This class handles Stadia input that comes from the Driver Station. Each time a value is requested the most recent value is returned. There is a single class instance for each controller and the mapping of ports to hardware buttons depends on the code in the Driver Station.

Construct an instance of a Stadia 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 (0-5).

A(loop: wpilib.event._event.EventLoop) wpilib.event._event.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.

class Axis

Bases: pybind11_object

Represents an axis on a StadiaController.

kLeftX = 0
kLeftY = 1
kRightX = 4
kRightY = 5
B(loop: wpilib.event._event.EventLoop) wpilib.event._event.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.

class Button

Bases: pybind11_object

Represents a digital button on a StadiaController.

kA = 1
kB = 2
kEllipses = 9
kFrame = 15
kGoogle = 14
kHamburger = 10
kLeftBumper = 5
kLeftStick = 7
kLeftTrigger = 13
kRightBumper = 6
kRightStick = 8
kRightTrigger = 12
kStadia = 11
kX = 3
kY = 4
X(loop: wpilib.event._event.EventLoop) wpilib.event._event.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.event._event.EventLoop) wpilib.event._event.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.

ellipses(loop: wpilib.event._event.EventLoop) wpilib.event._event.BooleanEvent

Constructs an event instance around the ellipses button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to.

Returns:

an event instance representing the ellipses button’s digital signal attached to the given loop.

frame(loop: wpilib.event._event.EventLoop) wpilib.event._event.BooleanEvent

Constructs an event instance around the frame button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to.

Returns:

an event instance representing the frame button’s digital signal attached to the given loop.

getAButton() bool

Read the value of the A button on the controller.

Returns:

The state of the button.

getAButtonPressed() bool

Whether the A button was pressed since the last check.

Returns:

Whether the button was pressed since the last check.

getAButtonReleased() bool

Whether the A button was released since the last check.

Returns:

Whether the button was released since the last check.

getBButton() bool

Read the value of the B button on the controller.

Returns:

The state of the button.

getBButtonPressed() bool

Whether the B button was pressed since the last check.

Returns:

Whether the button was pressed since the last check.

getBButtonReleased() bool

Whether the B button was released since the last check.

Returns:

Whether the button was released since the last check.

getEllipsesButton() bool

Read the value of the ellipses button on the controller.

Returns:

The state of the button.

getEllipsesButtonPressed() bool

Whether the ellipses button was pressed since the last check.

Returns:

Whether the button was pressed since the last check.

getEllipsesButtonReleased() bool

Whether the ellipses button was released since the last check.

Returns:

Whether the button was released since the last check.

getFrameButton() bool

Read the value of the frame button on the controller.

Returns:

The state of the button.

getFrameButtonPressed() bool

Whether the frame button was pressed since the last check.

Returns:

Whether the button was pressed since the last check.

getFrameButtonReleased() bool

Whether the frame button was released since the last check.

Returns:

Whether the button was released since the last check.

getGoogleButton() bool

Read the value of the google button on the controller.

Returns:

The state of the button.

getGoogleButtonPressed() bool

Whether the google button was pressed since the last check.

Returns:

Whether the button was pressed since the last check.

getGoogleButtonReleased() bool

Whether the google button was released since the last check.

Returns:

Whether the button was released since the last check.

getHamburgerButton() bool

Read the value of the hamburger button on the controller.

Returns:

The state of the button.

getHamburgerButtonPressed() bool

Whether the hamburger button was pressed since the last check.

Returns:

Whether the button was pressed since the last check.

getHamburgerButtonReleased() bool

Whether the hamburger button was released since the last check.

Returns:

Whether the button was released since the last check.

getLeftBumper() bool

Read the value of the left bumper (LB) button on the controller.

Returns:

the state of the button

getLeftBumperPressed() bool

Whether the left bumper (LB) was pressed since the last check.

Returns:

Whether the button was pressed since the last check

getLeftBumperReleased() bool

Whether the left bumper (LB) was released since the last check.

Returns:

Whether the button was released since the last check.

getLeftStickButton() bool

Read the value of the left stick button (LSB) on the controller.

Returns:

the state of the button

getLeftStickButtonPressed() bool

Whether the left stick button (LSB) was pressed since the last check.

Returns:

Whether the button was pressed since the last check.

getLeftStickButtonReleased() bool

Whether the left stick button (LSB) was released since the last check.

Returns:

Whether the button was released since the last check.

getLeftTriggerButton() bool

Read the value of the left trigger button on the controller.

Returns:

The state of the button.

getLeftTriggerButtonPressed() bool

Whether the left trigger button was pressed since the last check.

Returns:

Whether the button was pressed since the last check.

getLeftTriggerButtonReleased() bool

Whether the left trigger button was released since the last check.

Returns:

Whether the button was released since the last check.

getLeftX() float

Get the X axis value of left side of the controller.

Returns:

the axis value

getLeftY() float

Get the Y axis value of left side of the controller.

Returns:

the axis value

getRightBumper() bool

Read the value of the right bumper (RB) button on the controller.

Returns:

the state of the button

getRightBumperPressed() bool

Whether the right bumper (RB) was pressed since the last check.

Returns:

Whether the button was pressed since the last check

getRightBumperReleased() bool

Whether the right bumper (RB) was released since the last check.

Returns:

Whether the button was released since the last check.

getRightStickButton() bool

Read the value of the right stick button (RSB) on the controller.

Returns:

the state of the button

getRightStickButtonPressed() bool

Whether the right stick button (RSB) was pressed since the last check.

Returns:

Whether the button was pressed since the last check

getRightStickButtonReleased() bool

Whether the right stick button (RSB) was released since the last check.

Returns:

Whether the button was released since the last check.

getRightTriggerButton() bool

Read the value of the right trigger button on the controller.

Returns:

The state of the button.

getRightTriggerButtonPressed() bool

Whether the right trigger button was pressed since the last check.

Returns:

Whether the button was pressed since the last check.

getRightTriggerButtonReleased() bool

Whether the right trigger button was released since the last check.

Returns:

Whether the button was released since the last check.

getRightX() float

Get the X axis value of right side of the controller.

Returns:

the axis value

getRightY() float

Get the Y axis value of right side of the controller.

Returns:

the axis value

getStadiaButton() bool

Read the value of the stadia button on the controller.

Returns:

The state of the button.

getStadiaButtonPressed() bool

Whether the stadia button was pressed since the last check.

Returns:

Whether the button was pressed since the last check.

getStadiaButtonReleased() bool

Whether the stadia button was released since the last check.

Returns:

Whether the button was released since the last check.

getXButton() bool

Read the value of the X button on the controller.

Returns:

The state of the button.

getXButtonPressed() bool

Whether the X button was pressed since the last check.

Returns:

Whether the button was pressed since the last check.

getXButtonReleased() bool

Whether the X button was released since the last check.

Returns:

Whether the button was released since the last check.

getYButton() bool

Read the value of the Y button on the controller.

Returns:

The state of the button.

getYButtonPressed() bool

Whether the Y button was pressed since the last check.

Returns:

Whether the button was pressed since the last check.

getYButtonReleased() bool

Whether the Y button was released since the last check.

Returns:

Whether the button was released since the last check.

google(loop: wpilib.event._event.EventLoop) wpilib.event._event.BooleanEvent

Constructs an event instance around the google button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to.

Returns:

an event instance representing the google button’s digital signal attached to the given loop.

hamburger(loop: wpilib.event._event.EventLoop) wpilib.event._event.BooleanEvent

Constructs an event instance around the hamburger button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to.

Returns:

an event instance representing the hamburger button’s digital signal attached to the given loop.

leftBumper(loop: wpilib.event._event.EventLoop) wpilib.event._event.BooleanEvent

Constructs an event instance around the left bumper’s digital signal.

Parameters:

loop – the event loop instance to attach the event to.

Returns:

an event instance representing the left bumper’s digital signal attached to the given loop.

leftStick(loop: wpilib.event._event.EventLoop) wpilib.event._event.BooleanEvent

Constructs an event instance around the left stick’s digital signal.

Parameters:

loop – the event loop instance to attach the event to.

Returns:

an event instance representing the left stick’s digital signal attached to the given loop.

leftTrigger(loop: wpilib.event._event.EventLoop) wpilib.event._event.BooleanEvent

Constructs an event instance around the left trigger button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to.

Returns:

an event instance representing the left trigger button’s digital signal attached to the given loop.

rightBumper(loop: wpilib.event._event.EventLoop) wpilib.event._event.BooleanEvent

Constructs an event instance around the right bumper’s digital signal.

Parameters:

loop – the event loop instance to attach the event to.

Returns:

an event instance representing the right bumper’s digital signal attached to the given loop.

rightStick(loop: wpilib.event._event.EventLoop) wpilib.event._event.BooleanEvent

Constructs an event instance around the right stick’s digital signal.

Parameters:

loop – the event loop instance to attach the event to.

Returns:

an event instance representing the right stick’s digital signal attached to the given loop.

rightTrigger(loop: wpilib.event._event.EventLoop) wpilib.event._event.BooleanEvent

Constructs an event instance around the right trigger button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to.

Returns:

an event instance representing the right trigger button’s digital signal attached to the given loop.

stadia(loop: wpilib.event._event.EventLoop) wpilib.event._event.BooleanEvent

Constructs an event instance around the stadia button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to.

Returns:

an event instance representing the stadia button’s digital signal attached to the given loop.