Hello,
as I understand this is similiar to USB Gamepad report. In the code above is first printed state of digital buttons and then for sticks values.
This means that response[3] and response[4] includes state of all buttons - each bit in both bytes represents state of one button. So 8 bits in response[3] and 8 bits in response[4] represents state of all buttons.
Using for example if(response[3] &0x1){ do something} to check and base any action for specified button press.
You will use 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 to check each specified bit for status 0 or 1. 0x1 checks 8th bit (most right), 0x80 checks first bit(most left one)
response[5], response[6], response[7] and response[8] store status of all sticks axes in 0 - 255 or 0x00 - 0xFF hex with 127 or 0x80 hex for center. May they are ordered as x, y, z, rz.
Hey guys, I'm looking at the code here: http://mbed.org/users/simon/programs/PlayStationController/16mhs4 and I'm trying to understand this line:
I'm thinking there are 16 buttons on the controller with 2 analog sticks, so I should be receiving 16 button states and 4 stick values (left & right stick in x & y direction). How can I interpret the above 6 variables to represent this? Thanks!