> For the complete documentation index, see [llms.txt](https://docs.uninterruptedexception.team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uninterruptedexception.team/utils/gamepadex/joystickex.md).

# JoystickEx

<h2 align="center">Methods</h2>

### `setDeadzone()`&#x20;

Sets a deadzone for the joystick. Deadzones make it so that there has to be a minimum input before it outputs something besides 0. Recommended to set this to 0.15.

### `getCoordinates()`

Gets the coordinates of the joystick position. Returns an array {x, y}.

### `getXAxis()`

Gets the position of the joystick on the X axis.

### `getYAxis()`

Gets the position of the joystick on the Y axis.

### `getAngle()`

Gets the angle of the joystick in radians.

### `getAngleDeg()`

Gets the angle of the joystick in degrees.

<h2 align="center">Implementation</h2>

Unlike ButtonEx, this class does not require GamepadEx.

First define the joystick (name is `leftJoystick` as an example):

```
JoystickEx leftJoystick;
```

in `init()`, assign the joystick axes to the the variable:

```
leftJoystick = new JoystickEx(gamepad1.left_stick_x, gamepad1.left_stick_y);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.uninterruptedexception.team/utils/gamepadex/joystickex.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
