9min

Analog Stick Data

Decode Joystick Data

This is a section detailing how to interpret analog/joystick data coming from the controller.

Slow Mode/Short Input Report Joystick Data

Starting on byte 4 of the incoming report from the controller, you can find the joystick analog data encoded as follows.

Byte Number

Description

Example Data

4

Lower byte of X axis



5

Upper byte of X axis



6

Lower byte of Y axis



7

Upper byte of Y axis



To get values for the right stick, add 4 to the byte index.

To get the X or Y axis values, OR the respective bytes together.

C++
|

Standard Input Mode Joystick Data

Starting on byte 6 of a standard input mode report from the controller, you can find the joystick analog data encoded as follows.

Byte Number

Description

Example Data

6

Lower byte of X axis. 8 bits.



7

Lower 4 bits are the Upper byte of X axis. Upper 4 bits are the lower byte of the Y axis



8

Upper byte of Y axis. 8 bits.



For the right stick, add 3 to the byte index.

To get the decoded X or Y axis values, some math is involved.

C++
|

Encode Joystick Data

This section details how to take an analog stick value and encode it to be read by the console.

Slow Mode Joystick Data

In a standard input report, bytes 4-7 represent the stick data.

For this example, we will use these values and we will only focus on the left stick which is bytes 4-5.

X axis - 0x7D4 (2004 in decimal)

Y axis - 0x6C5 (1733 in decimal)

C++
|

Standard Input Mode Joystick Data

In a standard input report, bytes 6-11 represent the stick data.

For this example, we will use these values and we will only focus on the left stick which is bytes 6-8.

X axis - 0x7D4 (2004 in decimal)

Y axis - 0x6C5 (1733 in decimal)

C++
|



Updated 24 Jun 2022
Did this page help you?
Yes
No