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.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.getX(hand=None)[source]¶
Get the x position of HID.
Parameters: hand – which hand, left or right (default right) Returns: the x position