#elif JOYSTICK_SIZE == 64
// extreme joystick (to use this, edit JOYSTICK_SIZE to 64 in usb_desc.h)
// 128 buttons 16
// 6 axes 12
// 4 pov 2
// 17 sliders 34
static uint8_t joystick_report_desc[] = {
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x04, // Usage (Joystick)
0xA1, 0x01, // Collection (Application)
0xA1, 0x00, // Collection (Buttons)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x75, 0x01, // Report Size (1)
0x95, 0x80, // Report Count (128)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (Button #1)
0x29, 0x80, // Usage Maximum (Button #128)
0x81, 0x02, // Input (variable,absolute)
0xC0, // End Collection
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x01, // Usage (Pointer)
0xA1, 0x00, // Collection (Axes) - Default Axis Collection
0x15, 0x00, // Logical Minimum (0)
0x27, 0xFF, 0xFF, 0x00, 0x00, // Logical Maximum (65535)
0x75, 0x10, // Report Size (16)
0x95, 0x06, // Report Count (6)
0x09, 0x30, // Usage (X) DX X
0x09, 0x31, // Usage (Y) DX Y
0x09, 0x32, // Usage (Z) DXSlider #1
0x09, 0x33, // Usage (Rx) DX Rx
0x09, 0x34, // Usage (Ry) DX Ry
0x09, 0x35, // Usage (Rz) DX Rz
0x81, 0x42, // Input (variable,absolute,null_state)
0xC0, // End Collection
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x01, // Usage (Pointer)
0xA1, 0x00, // Collection (Axes) - Default Slider Collection
0x15, 0x00, // Logical Minimum (0)
0x27, 0xFF, 0xFF, 0x00, 0x00, // Logical Maximum (65535)
0x75, 0x10, // Report Size (16)
0x95, 0x02, // Report Count (2)
0x09, 0x36, // Usage (Slider) DX Z
0x09, 0x36, // Usage (Slider) DXSlider #2
0x81, 0x42, // Input (variable,absolute,null_state)
0xC0, // End Collection
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x01, // Usage (Pointer)
0xA1, 0x00, // Collection (Axes)
0x15, 0x00, // Logical Minimum (0)
0x27, 0xFF, 0xFF, 0x00, 0x00, // Logical Maximum (65535)
0x75, 0x10, // Report Size (16)
0x95, 0x0F, // Report Count (15)
0x09, 0x36, // Usage (Slider) DXSlider #17
0x09, 0x36, // Usage (Slider) DXSlider #16
0x09, 0x36, // Usage (Slider) DXSlider #15
0x09, 0x36, // Usage (Slider) DXSlider #14
0x09, 0x36, // Usage (Slider) DXSlider #13
0x09, 0x36, // Usage (Slider) DXSlider #12
0x09, 0x36, // Usage (Slider) DXSlider #11
0x09, 0x36, // Usage (Slider) DXSlider #10
0x09, 0x36, // Usage (Slider) DXSlider #9
0x09, 0x36, // Usage (Slider) DXSlider #8
0x09, 0x36, // Usage (Slider) DXSlider #7
0x09, 0x36, // Usage (Slider) DXSlider #6
0x09, 0x36, // Usage (Slider) DXSlider #5
0x09, 0x36, // Usage (Slider) DXSlider #4
0x09, 0x36, // Usage (Slider) DXSlider #3
0x81, 0x42, // Input (variable,absolute,null_state)
0xC0, // End Collection
0x05, 0x01, // Usage Page (Generic Desktop)
0xA1, 0x00, // Collection (Hats)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x07, // Logical Maximum (7)
0x35, 0x00, // Physical Minimum (0)
0x46, 0x3B, 0x01, // Physical Maximum (315)
0x75, 0x04, // Report Size (4)
0x95, 0x04, // Report Count (3)
0x65, 0x14, // Unit (Eng Rot: Degree)
0x09, 0x39, // Usage (Hat switch)
0x09, 0x39, // Usage (Hat switch)
0x09, 0x39, // Usage (Hat switch)
0x09, 0x39, // Usage (Hat switch)
0x81, 0x02, // Input (variable,absolute,null_state)
0xC0, // End Collection
0xC0 // End Collection
};
#endif // JOYSTICK_SIZE
Hello all, I am currently working on a button box using a Teensy 4.1 and the extreme joystick "setting". I have got all of the buttons functioning but my four sliders (https://uk.farnell.com/bourns/ptv09a-4020u-b104/pot-rotary-100kohm-9mm-20/dp/2469526) are not being read correctly.
I am using the Joystick test program that was posted in this thread a few years ago to test the button box and using DCS World (Flight Sim that can handle all the inputs) as back up testing.
The issue is when not using the extreme joystick "setting" the first 32 buttons work fine and so do all four pots, but when I use the extreme "setting" all of my buttons work (38 in total) but the effect my pots have in joystick test are negligible and are not picked up by DCS. In my code I added a serial print for the
analogue values being read from the pots and they are working fine (reading between 0 and 1023 as expected).
My belief is that the Teensy is reading the pots in 10bit but for some reason windows (and there for both my testing programs) are reading the number in 16bit.
Any help on this matter would be greatly appreciated with either changing what windows sees or what the Teensy sees.
Thank you for the response, I have now modified my usb_dec.c file, as backwards compatibility is always a good thing, but alas my issue still persists. I am getting minute movement on the X and Y axis and no movement being picked up on Z and Xrotate.
I have currently got it working via brute force. I have mapped all of the pot outputs to 0-65535 instead of 0-1023 and it works now.
Actually that would be what you have to do.. With the USB Headers that I developed above it has (17) 16bit sliders.. SO if you were only sending 10bit data raw there would be only minor movement on the sliders.. You need to use the map() function to remap the 1024 output to a 65535 output to use them without having to modify the header file.. You can modify the header file to tell windows that the sliders are 1024 (10bit) but that is definitely more involved.. The good side of doing that would be that you would not have to be doing the mapping calculations..