Skip to content

Commit e929905

Browse files
committed
Add setRumble and isConnected to CommandGenericHID
Follows wpilibsuite/allwpilib#6768
1 parent 4a953ab commit e929905

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

commands2/button/commandgenerichid.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,22 @@ def getRawAxis(self, axis: int) -> float:
186186
:returns: The value of the axis.
187187
"""
188188
return self._hid.getRawAxis(axis)
189+
190+
def setRumble(type: GenericHID.RumbleType, value: double):
191+
"""
192+
Set the rumble output for the HID.
193+
The DS currently supports 2 rumble values, left rumble and right rumble.
194+
195+
:param type: Which rumble value to set.
196+
:param value: The normalized value (0 to 1) to set the rumble to.
197+
"""
198+
this._hid.setRumble(type, value)
199+
200+
201+
def isConnected():
202+
"""
203+
Get if the HID is connected.
204+
205+
:returns: True if the HID is connected.
206+
"""
207+
return this._hid.isConnected()

0 commit comments

Comments
 (0)