Hello everyone!
I found many solution through this forum for my project without starting new topic but now its the time to make one
(My project: a joystick with 64 buttons and 4 axis on arduino mega2560 (64 buttons on 52digital pins + 12 analog pins, and 4 axis to 4 analog pins ))
a.
I want to modify descriptors to this http://hunt.net.nz/users/darran/weblog/a3599/Arduino_UNO_Joystick_HID_firmware.html
USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] =
{
0x05, 0x01, /* Usage Page (Generic Desktop) */
0x09, 0x04, /* Usage (Joystick) */
0xa1, 0x01, /* Collection (Application) */
0x09, 0x01, /* Usage (Pointer) */
0xa1, 0x00, /* Collection (Physical) */
0x05, 0x01, /* Usage Page (Generic Desktop) */
0x09, 0x30, /* Usage (X) */
0x09, 0x31, /* Usage (Y) */
0x15, 0x9c, /* Logical Minimum (-100) */
0x25, 0x64, /* Logical Maximum (100) */
0x75, 0x08, /* Report Size (8 ) */
0x95, 0x02, /* Report Count (2) */
0x81, 0x82, /* Input (Data, Variable, Absolute, Volatile) */
0xc0, /* End Collection */
0x95, 0x1E, /* Report Count (30) */
0x75, 0x01, /* Report Size (1) */
0x05, 0x09, /* Usage Page (Button) */
0x19, 0x01, /* Usage Minimum (Button 1) */
0x29, 0x1E, /* Usage Maximum (Button 30) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0x01, /* Logical Maximum (1) */
0x81, 0x02, /* Input (Data, Variable, Absolute) */
0x75, 0x02, /* Report Size (2) */
0x95, 0x01, /* Report Count (1) */
0x81, 0x01, /* Input (Constant) */
0xc0 /* End Collection */
};
in order to extend my joystick on to 64 buttons!
b.
i also need a small guide about how to extend the joystick report to 64 buttons.
byte0 : Bits 0-7 => x1 axis (int8_t x1;)
byte1 : Bits 0-7 => y1 axis (int8_t y1;)
byte2 : Bits 0-7 => z rotation (int8_t z;)
byte3 : Bits 0-7 => x rotation (int8_t x;)
byte4 : Bits 0-7 => 1-8 buttons (uint8t_t buttons1_8;)
byte5 : Bits 8-15 => 9-16 buttons (uint8t_t buttons9_16;)
byte6 : Bits 16-23 => 17-24 buttons (uint8t_t buttons17_24;)
byte7 : Bits 24-31 => 25-32 buttons (uint8t_t buttons25_32;)
byte8 : Bits 32-39 => 33-40 buttons (uint8t_t buttons33_40;)
byte9 : Bits 40-47 => 41-48 buttons (uint8t_t buttons41_48;)
byte10 : Bits 48-55 => 49-56 buttons (uint8t_t buttons49_56;)
byte11 : Bits 56-64 => 55-64 buttons (uint8t_t buttons57_64;)
the byte4 to byte7 is the same with that (uint32_t buttons1_32;) ??
according this, if its ok, the
typedef struct {
int8_t x; /**< Current absolute joystick X position, as a signed 8-bit integer */
int8_t y; /**< Current absolute joystick Y position, as a signed 8-bit integer */
uint32_t button; /**< Bit mask of the currently pressed joystick buttons */
} USB_JoystickReport_Data_t;
will become like this ???
typedef struct {
int8_t x1; /**< Current absolute joystick X position, as a signed 8-bit integer */
int8_t y1; /**< Current absolute joystick Y position, as a signed 8-bit integer */
int8_t z;
int8_t x;
uint32_t buttons1_32; /**< Bit mask of the currently pressed joystick buttons */
uint32_t buttons33_64;
} USB_JoystickReport_Data_t;
Thanks a lot for your time!!