GenericHID

class wpilib.interfaces.GenericHID[source]

Bases: builtins.object

GenericHID Interface

class Hand[source]

Bases: builtins.object

Which hand the Human Interface Device is associated with.

kLeft = 0

Left hand

kRight = 1

Right hand

GenericHID.getBumper(hand=None)[source]

Is the bumper pressed?

Parameters:hand – which hand (default right)
Returns:True if the bumper is pressed
GenericHID.getPOV(pov=0)[source]

Get the state of a POV.

Parameters:pov – which POV (default is 0)
Returns:The angle of the POV in degrees, or -1 if the POV is not pressed.
GenericHID.getRawAxis(which)[source]

Get the raw axis.

Parameters:which – index of the axis
Returns:the raw value of the selected axis
GenericHID.getRawButton(button)[source]

Is the given button pressed?

Parameters:button – which button number
Returns:True if the button is pressed
GenericHID.getThrottle()[source]

Get the throttle.

Returns:the throttle value
GenericHID.getTop(hand=None)[source]

Is the top button pressed

Parameters:hand – which hand (default right)
Returns:True if the top button for the given hand is pressed
GenericHID.getTrigger(hand=None)[source]

Is the trigger pressed

Parameters:hand – which hand (default right)
Returns:True if the trigger for the given hand is pressed
GenericHID.getTwist()[source]

Get the twist value.

Returns:the twist value
GenericHID.getX(hand=None)[source]

Get the x position of HID.

Parameters:hand – which hand, left or right (default right)
Returns:the x position
GenericHID.getY(hand=None)[source]

Get the y position of the HID.

Parameters:hand – which hand, left or right (default right)
Returns:the y position
GenericHID.getZ(hand=None)[source]

Get the z position of the HID.

Parameters:hand – which hand, left or right (default right)
Returns:the z position