GenericHID¶
-
class
wpilib.interfaces.
GenericHID
(port)[source]¶ Bases:
object
GenericHID Interface.
-
class
HIDType
(value)[source]¶ Bases:
object
-
kHID1stPerson
= 24¶
-
kHIDDriving
= 22¶
-
kHIDFlight
= 23¶
-
kHIDGamepad
= 21¶
-
kHIDJoystick
= 20¶
-
kUnknown
= -1¶
-
kXInputArcadePad
= 19¶
-
kXInputArcadeStick
= 3¶
-
kXInputDancePad
= 5¶
-
kXInputDrumKit
= 8¶
-
kXInputFlightStick
= 4¶
-
kXInputGamepad
= 1¶
-
kXInputGuitar
= 6¶
-
kXInputGuitar2
= 7¶
-
kXInputGuitar3
= 11¶
-
kXInputUnknown
= 0¶
-
kXInputWheel
= 2¶
-
-
class
Hand
[source]¶ Bases:
object
Which hand the Human Interface Device is associated with.
-
kLeft
= 0¶ Left Hand
-
kRight
= 1¶ Right Hand
-
-
class
RumbleType
[source]¶ Bases:
object
Represents a rumble output on the JoyStick.
-
kLeftRumble
= 0¶ Left Hand
-
kRightRumble
= 1¶ Right Hand
-
-
getAxisCount
()[source]¶ Get the number of axes for the HID
Returns: The number of axis for the current HID
-
getPOV
(pov=0)[source]¶ Get the angle in degrees of a POV on the HID.
The POV angles start at 0 in the up direction, and increase clockwise (eg right is 90, upper-left is 315).
Parameters: pov – The index of the POV to read (starting at 0) Returns: the angle of the POV in degrees, or -1 if the POV is not pressed.
-
getRawAxis
(axis)[source]¶ Get the raw axis.
Parameters: axis – index of the axis Returns: the raw value of the selected axis
-
getRawButton
(button)[source]¶ Is the given button pressed.
Parameters: button – which button number Returns: the angle of the POV in degrees, or -1 if the POV is not pressed.
-
getRawButtonPressed
(button)[source]¶ Whether the button was pressed since the last check. Button indexes begin at 1.
Parameters: button – The button index, beginning at 1. Returns: Whether the button was pressed since the last check.
-
getRawButtonReleased
(button)[source]¶ Whether the button was released since the last check. Button indexes begin at 1.
Parameters: button – The button index, beginning at 1. Returns: Whether the button was released since the last check.
-
getX
(hand=None)[source]¶ Get the x position of HID.
Parameters: hand – which hand, left or right Returns: the x position
-
getY
(hand=None)[source]¶ Get the y position of the HID.
Parameters: hand – which hand, left or right Returns: the y position
-
setOutput
(outputNumber, value)[source]¶ Set a single HID output value for the HID.
Parameters: - outputNumber – The index of the output to set (1-32)
- value – The value to set the output to
-
class