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.
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.
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)
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)
๏ปฟ
