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

Thread: Multi 5-direction switch-based joystick with 1 Teensy, Possible?

  1. #1
    Junior Member
    Join Date
    Jan 2019
    Posts
    3

    Multi 5-direction switch-based joystick with 1 Teensy, Possible?

    Hello, my question is:

    I want to connect 5 X 5-direction switch-based joystick (thumb stick) plus 12 Normal Buttonson a Teensy.

    Is it possible, what kind of 5-direction switch-based joystick would work at best. This is what I found
    = Five Direction Navigation Button Module for MCU AVR Game 5D Rocker Joystick Independent Keyboard for Arduino Joystick Module

    How must I set it up that it would work?

    thanks for the tips and help, Cheers

  2. #2
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,876
    If the aim is to output 5 two axis joysticks you need 10 axis total, which hits various limits in how joysticks are expected to work. https://forum.pjrc.com/threads/23681-Many-axis-joystick

    You may also have trouble at the computer end trying to input this many axis even from multiple devices unless you are planing to write custom drivers. If you are planing to write custom code for a special project this may actually work better as a serial device.

    Going back to the button inputs a single Teensy could just about read all the IO, but to avoid a complete mess of wire something like this https://www.adafruit.com/product/593, 1 per joystick may tame things or using https://www.pjrc.com/teensy/td_libs_Keypad.html, wired as a 6*5 (rows being each joystick axis+buttons, columns separating the joysticks).

    In terms of the actual axis hardware best advice is to buy some and see. Things move quickly in online sales and the choice will matter far more on the feel and how it will mount into your project than on the electrical aspects so very hard to provide any advice.

  3. #3
    Junior Member
    Join Date
    Jan 2019
    Posts
    3

    few site`s and info`s I found

    Quote Originally Posted by GremlinWrangler View Post
    If the aim is to output 5 two axis joysticks you need 10 axis total, which hits various limits in how joysticks are expected to work. https://forum.pjrc.com/threads/23681-Many-axis-joystick

    You may also have trouble at the computer end trying to input this many axis even from multiple devices unless you are planing to write custom drivers. If you are planing to write custom code for a special project this may actually work better as a serial device.

    Going back to the button inputs a single Teensy could just about read all the IO, but to avoid a complete mess of wire something like this https://www.adafruit.com/product/593, 1 per joystick may tame things or using https://www.pjrc.com/teensy/td_libs_Keypad.html, wired as a 6*5 (rows being each joystick axis+buttons, columns separating the joysticks).

    In terms of the actual axis hardware best advice is to buy some and see. Things move quickly in online sales and the choice will matter far more on the feel and how it will mount into your project than on the electrical aspects so very hard to provide any advice.
    Thank you for youre help, I found this:

    https://forum.pjrc.com/threads/23681...ll=1#post41942
    https://hackaday.com/2014/02/14/the-...ck-controller/
    http://www.leobodnar.com/products/BU0836/
    http://www.leobodnar.com/shop/index....roducts_id=204

    The Idea is to map later when Hardware is installed, the end Axis as Button like I can do on xpadder, maybe using just 2-3 Axis and the rest as buttons so ill have five buttons in one, it is the best way to save space and wiring, when you think about it.

    what do you think of these: https://www.amazon.com/MakerHawk-5-C...based+joystick

    or: https://www.aliexpress.com/item/Five...3-b460b3d8f6f4

    https://www.amazon.com/WMYCONGCONG-J...ystick+arduino

    what do you think Gremlin?

  4. #4
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,876
    That one that looks like a playstation thumb stick is analog, so would need an analog pin and more complex read process but also acts as a true variable stick if that is what you are after.

    Otherwise the choice mostly depends on how you want to mount and use this. If it is to be a continuous use think about how your fingers will cope with the nub on top of the button, bigger and more robust may help. But be more expensive.

    Would strongly suggest you plan this as a several stage project, and assume you will need to build at least one, possibly two prototypes and budget accordingly. Start first design with one each of your planned inputs and make sure it works, then go big.

  5. #5
    Junior Member
    Join Date
    Jan 2019
    Posts
    3
    Quote Originally Posted by GremlinWrangler View Post
    That one that looks like a playstation thumb stick is analog, so would need an analog pin and more complex read process but also acts as a true variable stick if that is what you are after.

    Otherwise the choice mostly depends on how you want to mount and use this. If it is to be a continuous use think about how your fingers will cope with the nub on top of the button, bigger and more robust may help. But be more expensive.

    Would strongly suggest you plan this as a several stage project, and assume you will need to build at least one, possibly two prototypes and budget accordingly. Start first design with one each of your planned inputs and make sure it works, then go big.
    Thanks, so what parts would you recomend, which Teensy, buttons, sticks etc.?

  6. #6
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,876
    As stated above, you have not provided enough information on what you actually want to do to provide meaningful advice since that depends on mounting/fitting/feel decisions. Quality also matters and unclear here if this is something you are doing for fun or an industrial project that needs to run for years.

    Anything sold as a electrical button with two or three exposed contacts will work with a Teensy, and unless you find some obscure industrial input device anything with a restive output will also work. If you can best step for the hardware is to go looking at a place that actually sells such things and have a look and feel, make sure you can mount them etc.

    In terms of Teensy the T3.2 would be needed if you go for one pin per IO because it has more inputs. If using expanders, matrix or multiple teensies the cheaper LC has plenty of processing horsepower for what you want. If you have not worked with Arduino before a key first step is to download and install arduino and the Teensyduino add on, rough out a design and rough out some code for your chosen setup and see if you can get far enough it actually compiles. If you cannot get it to compile then time for a rethink.

    An option is to skip the teensy entirely and buy three USB controllers and re-wire them.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,169
    Quote Originally Posted by XBlade View Post
    Thank you for youre help, I found this:

    https://forum.pjrc.com/threads/23681...ll=1#post41942
    That extreme joystick code became part of the normal Teensyduino install, as mentioned in msg #124 on that thread. But it's disabled by default. The turn it on, you would edit usb_desc.h and change the joystick endpoint size. See the comments in that file.

    However, not all operating systems have software that are able to access so many axes. Last time I checked, Microsoft Windows in particular was limited to only the first 8 axes, at least when using their control panel. Maybe other software can read more? I do not know. I can tell you for sure it works on Linux... as you might guess from the screenshot on that thread.

    As for which Teensy to recommend, I'd suggest starting with Teensy 3.5, mainly because it offers so many pins. If you weren't connecting so much stuff, from only a CPU power and memory perspective, Teensy LC is probably plenty for this project. But with the smaller boards it's easy to run out of pins. There are complicated ways to do more with fewer pins, but if things don't work perfectly on the first try those ways are hard to troubleshoot. For a project like this needing to wire up a lot of stuff, go with Teensy 3.5.

    Also mentioned on that thread, but maybe worth repeating here, is Teensy 2.0 and Teensy++ 2.0 do *NOT* support the many-axis joystick code. You need at least Teensy LC or 3.x.

Posting Permissions

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