Skip to content

Commit 5669bb9

Browse files
committed
Update README.rst to include Gamepad info.
1 parent ba340a2 commit 5669bb9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,22 @@ remote controls, or the multimedia keys on certain keyboards.
136136
# Pause or resume playback.
137137
cc.send(ConsumerControlCode.PLAY_PAUSE)
138138
139+
The ``Gamepad`` class emulates a two-joystick gamepad with 16 buttons.
140+
141+
*New in CircuitPython 3.0.*
142+
143+
.. code-block:: python
144+
145+
from adafruit_hid.gamepad import Gamepad
146+
147+
gp = Gamepad()
148+
149+
# Click gamepad buttons.
150+
gp.click_buttons(1, 7)
151+
152+
# Move joysticks.
153+
gp.move_joysticks(x=2, y=0, z=-20)
154+
139155
Contributing
140156
============
141157

0 commit comments

Comments
 (0)