Physically, the Analog Joystick consist of two
standard joysticks, linked by a control panel with standard
switches. The joystick can act in either digital or analogue
mode.
Make sure you include a Calibration menu (0 position calibration,
idle movement, sensitivity etc.) in your application.
The 8 byte Controller packet (giving the status of the Controller) which can be returned at every vsync call back consists of the following for the Analog Joystick.
Byte No | Type | Bit No./Value | Button Assignment |
1 | Buffer Status | 8 bits | 0x00: success; 0xff: failure |
2 | Data length Controller type |
bits 0 - 3 bits 4 - 7 (8 bits total) |
data length/2 (= 0x03) Controller type (0x05) (Analog Joystick is 5) |
3, 4 | Status of 14 digital buttons | 16 bits | 0x00: push ; 0x01 : release (as per standard Controller - however L1/L2/R1/R2 are not present on stick) |
5 - 8 | Analogue value (4 values) | 4 x 8 bits | range 0x00 - 0xff. (x, y) , (x, y) |