First of all, lets see what a ps2 controller is made up of..
A normal controller consists of 16 hard buttons and 2 analog 2-axis encoders..
the byte contains the information of the buttons which are pressed..
the wires of a ps2 remote are…
the first 3 command which are sent on command line are the configuration bytes…
nothing is returned in this process.. the ps2 is configured to send the next bytes..
after this, ps2 returns a byte for each command on command line..
first byte: D-Pad, Start, Stop, And analog “buttons”
second byte: L1,L2,R1,R2, circle, triangle, square, cross
third byte: joystick- Right x axis
fourth byte: joystick- Right y axis
fifth byte: joystick- left x axis
sixth byte: joystick- left y axis