Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Teensy 4.1 Joystick Support

  1. #1
    Junior Member
    Join Date
    Sep 2020
    Posts
    6

    Teensy 4.1 Joystick Support

    Hello,

    I am working on developing a Microsoft Flight Simulator interface for my home cockpit. I purchased a Teensy 4.1 and four (4) CD74HC4067 16 channel mux boards (to increase I/O count). I have done some research online and it looks like Windows has a maximum joystick button limit of 32. Can the Teensy 4.1 be setup to appear to Windows as multiple joystick each with 32 buttons? I would like to have 90+ hardware buttons assignable in the Flight Simulator.

    Thanks for your support.

    Greg M.

  2. #2
    Junior Member
    Join Date
    Sep 2020
    Posts
    6
    After more digging it looks like I need to modify the usb_desc.h file. In the Arduino software I have selected Serial+Keyboard+Mouse+Joystick. Can I copy/paste this in the usb_desc.h file and create a Serial+Joystick+Joystick+Joystick? This would give me 32x3=96 buttons (and 3 joysticks in Windows game controllers menu). Is this possible?

  3. #3
    Junior Member
    Join Date
    Sep 2020
    Posts
    6
    Is anyone familiar with the usb_desh.h file? I need to understand how to modify to have multiple joysticks.

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,615
    There are two standard configurations of the USB Joystick code that is part of Teensyduino...

    You might want to look at the thread: https://forum.pjrc.com/threads/23681-Many-axis-joystick

    Look at the sources for the file usb_desc.h
    And change the define: #define JOYSTICK_SIZE 12 // 12 = normal, 64 = extreme joystick
    To 64 and then:
    And then the system is defined for:
    Code:
    #elif JOYSTICK_SIZE == 64
    // extreme joystick  (to use this, edit JOYSTICK_SIZE to 64 in usb_desc.h)
    //  128 buttons   16
    //    6 axes      12
    //   17 sliders   34
    //    4 pov        2

  5. #5
    Junior Member
    Join Date
    Sep 2020
    Posts
    6
    I got the Teensy 4.1 working with 128 buttons. Below are the steps I performed to get it working.

    Step 1: Navigate to "C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\"
    Step 2: Open the file usb_desc.h and change the following:
    Original #define JOYSTICK_SIZE 12
    New #define JOYSTICK_SIZE 64
    Step 3: In Arduino IDE, change USB type to Serial+Keyboard+Mouse+Joystick
    Step 4: Upload program

    Note: If you use Windows 10 default game controller calibration screen (built into windows), it only shows 32 buttons available.
    You will need to use your game control setup screen or the below game controller test application to see all the available buttons.

    http://www.planetpointy.co.uk/joysti...t-application/

    Enjoy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •