PORTS Forum

Ports and Interfaces => USB => Topic started by: yindengxie on August 12, 2020, 11:14:31 am

Title: Joystick x-axis position, y-axis position, z-axis position and buttons data
Post by: yindengxie on August 12, 2020, 11:14:31 am
Hello Jan,

   Are the Joystick  x-axis position,  y-axis position, z-axis position and buttons data put
in the INPUT REPORT to send to Host ?  So we decode the INPUT REPORT to get the Joystick
 x-axis position,  y-axis position, z-axis position and buttons data,  is it correct?

         THANKS!
Title: Re: Joystick x-axis position, y-axis position, z-axis position and buttons data
Post by: ulao on August 14, 2020, 12:03:05 pm
Your report reflects the descriptor. If you call out a x,y,z axis with 8 buttons you get 4 reports. If you give it a report ID you will have 5 reports.
 if the Report ID is specified in the descriptor
report 0 report ID
report 1 X
report 2 Y
report 3 Z
report 4 buttons

 if the Report ID is specified in the descriptor
report 0 X
report 1 Y
report 2 Z
report 3 buttions

Depending how the descriptor is laid out you may also have
report 0 buttions
report 1 X
report 2 Y
report 3 Z

So it all depends how you define it.
Title: Re: Joystick x-axis position, y-axis position, z-axis position and buttons data
Post by: yindengxie on August 14, 2020, 03:05:52 pm
Hello ulao,

 Good info for me.
 
 Many thanks!