Think it may be the struct. This it just snippets of the code i have changed 0x05, 0x02. USAGE_PAGE (Simulation Controls) 0x09, 0xbb, USAGE (Throttle) 0x15, 0x00, LOGICAL_MINIMUM (0) 0x26, 0xff, 0x03, LOGICAL_MAXIMUM (1023) 0x75, 0x10, REPORT_SIZE (16) putting this as 16 bit for 0x95, 0x01, REPORT_COUNT (1) future ADC upgrade 0x81, 0x02 INPUT (Data,Var,Abs) Joystick_::Joystick_() void Joystick_::move(uint8_t x, uint8_t y, uint8_t Rudder, uint16_t throttle, uint8_t buttons) u8 j; j x; j y; j Rudder; j throttle; j buttons; HID_SendReport(Report number, array of values in same order as HID descriptor, length) HID_SendReport(4, j, 5); class Joystick_ public: Joystick_(); void move(uint8_t x, uint8_t y, uint8_t Rudder, uint16_t throttle, uint8_t buttons); ; extern Joystick_ Joystick; You are not really using that struct, you are trying to pack 16 bit variables into a 8 bit array.
You need to learn to use type casting and cast your. Struct into an array, not use a separate array. I am proper stuck could you show me how to put. That into practice. research typecasting structures to byte arrays This is true but it8217;s a preference of mine to keep it between -127 and 127 for the sake of keeping 0 right in the middle. Okay, thats a good point ?.
I played a bit with the. Descriptors, but i dont really understand the whole thing. Its so complicated : I tried to add a System shutdown or sleep. Functionality, but it doesnt work. Any idea whats wrong here. i tried different version, nothing was working. or is just my win7 the problem. char ReportDescriptor 0x05, 0x01. USAGE_PAGE (Generic Desktop) 0x09, 0x80, USAGE (System Control) 0xa1, 0x01, COLLECTION (Application) 0x85, 0x05, REPORT_ID (5) 0x05, 0x01, USAGE_PAGE (Generic Desktop) 0x19, 0x00, USAGE_MINIMUM (Undefined) 0x29, 0x8d, USAGE_MAXIMUM (System Menu Down) 0x95, 0x01, REPORT_COUNT (1) 0x75, 0x10, REPORT_SIZE (16) 0x15, 0x00, LOGICAL_MINIMUM (0) 0x26, 0xff, 0x03, LOGICAL_MAXIMUM (1023) 0x81, 0x00, INPUT (Data,Ary,Abs) 0xc0 END_COLLECTION ; And i found another working code for Media keys like playpause.
Its working, i understood it but the line with. 0x00, 0x00 i dont understand. it is nesessary, but why.