> For the complete documentation index, see [llms.txt](https://vrs-guidebook-2nd-edition.gitbook.io/vrs-guidebook-2nd-edition/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vrs-guidebook-2nd-edition.gitbook.io/vrs-guidebook-2nd-edition/programming/blocks/gamepad.md).

# Gamepad

A series of blocks that allow you to read gamepad button presses, joystick positions, and trigger values to command your robot's movements and actions.<br>

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfdFPnv411xKH5rWpDRS6s6I1DrZJU2mZVE4RMKY7Mub_lb4S8SdP4mpZxKmuhpqVmRnD_ANf3ZFpaVQqtqtLJ0d80I_0jSbq09gGuu_VB3v5UDBpMpMPZNBhTCZ8Mn8usJ_oHBj3bIq9tdsjDPfJRGtSmL?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Here is a diagram laying out what each button is mapped to:

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeC3W_kordFtvJy-Fav34rEmR7y7jO0MWSpYCc3qpGBlDVG_ouyNhrZP4-nle7ltbeciLMDLlfQScKxz9cP1039I-nCeKSrihMXdBmMWJb3cmHop4O07E5iQ7XO5I4NtK3kFvXOOue12CmzkTsRUKOk95I?key=hRw9bBhBfp1lHBJ7rUAI2Q)

\
There are four main types of gamepad blocks:

* Button blocks: These blocks represent the various buttons on the gamepad (A, B, X, Y, D-pad, bumpers, triggers, etc.). They return a boolean value (true or false) indicating whether the button is pressed or not.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe3V-etq4KBIQMO8t-x9pAhLSo-rwQc_HNVd-o9pQ7UDEP06n93Zcd6rqThZOPWecFBBhE5cgZuckxaU7YtcGB34Rn98Jj4c88cV7UYPRz-l1r1W7Ot-K-iNE1UrtK3t_qchU4T7Fov3qWs1HYaZHDCdAQb?key=hRw9bBhBfp1lHBJ7rUAI2Q)

* Joystick blocks: These blocks provide the X and Y coordinates of the left and right joysticks. The values range from -1 to 1, representing the full range of motion of the joystick.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc0jaTJNEuLn-Ld4bwSEq2eB5qgSC5Sg_BptRri1b_68aRdbgHrfPrPrenQwpqeqw-MVuZVvj8H9Ln9YF4CUgwiwYTzw-iyye3VzGW6MLp87Z0lmFJd7H8PM3f920-o7HGnCdN7Y7Q6xUdetmV3bQoLyib8?key=hRw9bBhBfp1lHBJ7rUAI2Q)

* Trigger blocks: These blocks provide a value between 0 and 1, representing the trigger's position.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdAHvdR02-Di1A8kT9odbYbyf9fwKttqyS4b_8nhNUGLYhPBBIOw0Zk1slCjl6s7OXQuW-X57-Z_-ePLcUdt_mteikgY3QYxFFwO79sjThCGMLLGhcRMpN1i6-EhsdSB7gbYp0vZSDyD-yIDyUAEQncJG9C?key=hRw9bBhBfp1lHBJ7rUAI2Q)

* The status of the gamepad. There is only one block of this type. AtRest block returns true if all analog sticks and triggers are in their rest position.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfozKKutXBCofZOt9VXT3bUGNJHAnshxar9LbSZMZQer7Ph1g5DCbT7CnBnKjmGYFrSFIQfpf7R3o70wl4O4TASk946db31aKjTmO10xQqpimJ1raWjX3UI4kkuK0BV_w72mCanzLdGzpr21PvHJCvpiW2z?key=hRw9bBhBfp1lHBJ7rUAI2Q)
