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

Thread: Teensy Appropriate for my Sim Cockpit?

  1. #1

    Teensy Appropriate for my Sim Cockpit?

    Good evening all. After searching the forum and not finding exact answers, I decided I had to post. I am curious as to whether or not this community thinks a Teensy controller would suit my needs over an Arduino Mega 2560 r3 (or multiple).

    I would like to have the following be interpreted by X Plane 11 as a USB device:
    - 18 small toggle switches
    - 10 standard potentiometers

    My questions are as follows:
    - Can any Teensy controller handle that many analog inputs without a multiplexer or indexing?
    - If any can, will board current/wattage be an issue?
    - What is the ease of use of the Teensy X Plane USB integration platform?

    Thank you very much for any and all advice. I appreciate all of your time and expertise.
    Tony C

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,370
    Quote Originally Posted by crupianthonyj View Post
    Good evening all. After searching the forum and not finding exact answers, I decided I had to post. I am curious as to whether or not this community thinks a Teensy controller would suit my needs over an Arduino Mega 2560 r3 (or multiple).

    I would like to have the following be interpreted by X Plane 11 as a USB device:
    - 18 small toggle switches
    - 10 standard potentiometers

    My questions are as follows:
    - Can any Teensy controller handle that many analog inputs without a multiplexer or indexing?
    - If any can, will board current/wattage be an issue?
    - What is the ease of use of the Teensy X Plane USB integration platform?

    Thank you very much for any and all advice. I appreciate all of your time and expertise.
    Tony C
    I can't answer most of the questions, but all Teensy LC/3.2/3.5/3.6/4.0/4.1 have at least 10 pins that can do analog input on the main set of pins. Now with some of them, 10 analog inputs is the main number of analog pins, and you wouldn't be able to use I2C (since the main I2C device uses 2 analog pins).

    • The Teensy 4.1 has 18 analog input pins on the main rows of pins. I believe the Teensy 4.1 is the only one available right now.
    • The Teensy 4.0 has 10 analog inputs on the main rows of pins, and 4 analog inputs that you can access via soldering to jumper pads under the Teensy. The Teensy 4.0 should be available in a few weeks.
    • The Teensy 3.5 has 21 analog inputs on the main rows of pins, 4 analog inputs soldered to other holes, and 2 more analog pins on solder pads under the Teensy. Note, the 3.5 is currently not available, but a limited number of them should be available in a few weeks.


    However, the analog pins would each consume a pin slot, and the Teensy 4.1 only has 24 pins total on the main row of pins (there are also 7 more pins on solder tabs under the Teensy 4.1 that are normally used for adding extra memory but you could use them via soldered wires if desired).

    So I would suggest moving the toggle pins off to 2 I2C devices if you need the full 18 pins (or use other methods like shift registers).

  3. #3
    Thank you Michael. That is extremely relevant information.

    I did some more digging and it sounds like using an A-PAC like the following one might suit me better- even though there are fewer potentiometer inputs, there will likely be less time spent in software development. What do you think?

    https://www.ultimarc.com/control-int...s/a-pac/a-pac/

  4. #4
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,370
    Quote Originally Posted by MichaelMeissner View Post
    I can't answer most of the questions, but all Teensy LC/3.2/3.5/3.6/4.0/4.1 have at least 10 pins that can do analog input on the main set of pins. Now with some of them, 10 analog inputs is the main number of analog pins, and you wouldn't be able to use I2C (since the main I2C device uses 2 analog pins).

    • The Teensy 4.1 has 18 analog input pins on the main rows of pins. I believe the Teensy 4.1 is the only one available right now.
    • The Teensy 4.0 has 10 analog inputs on the main rows of pins, and 4 analog inputs that you can access via soldering to jumper pads under the Teensy. The Teensy 4.0 should be available in a few weeks.
    • The Teensy 3.5 has 21 analog inputs on the main rows of pins, 4 analog inputs soldered to other holes, and 2 more analog pins on solder pads under the Teensy. Note, the 3.5 is currently not available, but a limited number of them should be available in a few weeks.


    However, the analog pins would each consume a pin slot, and the Teensy 4.1 only has 24 pins total on the main row of pins (there are also 7 more pins on solder tabs under the Teensy 4.1 that are normally used for adding extra memory but you could use them via soldered wires if desired).

    So I would suggest moving the toggle pins off to 2 I2C devices if you need the full 18 pins (or use other methods like shift registers).
    Whoops, I can't count. The Teensy 4.1 has 42 digital pins on the main rows of pins (out of 48 total pins). And 18 of those pins can be analog inputs, leaving 32 pins for digital uses after using 10 out of the 18 total pins for potentiometers. But I to tend to think when you get to large number of pins or potentiometers, that you will run into errors just due to the number of pins that you need to verify. I.e. if you have 28 buttons and potentiometers, you will need to verify each of those wires goes to the right pin is connecting to the write switch or pot, and that you don't have shorts or what have you.

  5. #5
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,370
    Quote Originally Posted by crupianthonyj View Post
    Thank you Michael. That is extremely relevant information.

    I did some more digging and it sounds like using an A-PAC like the following one might suit me better- even though there are fewer potentiometer inputs, there will likely be less time spent in software development. What do you think?

    https://www.ultimarc.com/control-int...s/a-pac/a-pac/
    No idea. I generally don't code stuff with lots and lots of button and potentiometers.

  6. #6
    No problem. I think Leo Bodnar's BBI boards might also suit my purposes better considering code and plugins will not be a factor. Thank you for the data Michael!

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    27,372
    Quote Originally Posted by crupianthonyj View Post
    sounds like using an A-PAC like the following one might suit me better- even though there are fewer potentiometer inputs, there will likely be less time spent in software development. What do you think?
    Looks like it only supports 4 analog inputs, far short of the 10 you wanted. Looks like it needs no programming, but on the PC side you'll need to do configuration work to map the game controller axes and buttons to whatever flight sim functions you wanted. If you already have other stuff acting as game controllers, like a yoke or throttle, you'll need to keep a clear idea of which controller is which inputs. If all that is manageable and you really want to avoid any coding, a product like A-PAC is probably a good choice.

    For X-plane, Teensy has a special Flight Sim Controls option which you select from Tools > USB Type in Arduino. Full documentation is here:

    https://www.pjrc.com/teensy/td_flightsim.html

    Obviously everything about using Teensy involves some programming. If you keep your hardware connection simple, just 1 pot per analog pin and 1 switch per digital pin, the programming is pretty simple and you can probably do is all by just copy-paste from examples.

    The nice advantage of using Flight Sim Controls is you can put your X-Plane Dataref names directly into the code on Teensy, so it will always associate each button or pot with the intended flight sim features regardless of what other USB devices are present or what order they're plugged and unplugged from your PC. The TeensyControls plugin for X-Plane even lets you unplug and reconnect (or reprogram with Arduino) with the simulator is running and it always automatically connects to the intended Datarefs before those names are baked right into the code you store on Teensy.

    Theoretically you could connect a huge number of analog inputs and switches by using hardware like analog mux chips and digital shift registers. But if you want to keep the code simple, and any troubleshooting of problems simpler, best to avoid those more complicated connections. You can use many Teensy boards simultaneously with X-Plane and TeensyControls and every input always controls the intended Dataref according to the code you loaded. If you do go down that road with multiple Teensy boards, and multiple programs in Arduino, it's simplest to program them by using Verify in Arduino and then physically press the button on the intended Teensy to initiate the programming... since from the menu in the software they all look the same.

  8. #8
    Quote Originally Posted by PaulStoffregen View Post
    Looks like it only supports 4 analog inputs, far short of the 10 you wanted. Looks like it needs no programming, but on the PC side you'll need to do configuration work to map the game controller axes and buttons to whatever flight sim functions you wanted. If you already have other stuff acting as game controllers, like a yoke or throttle, you'll need to keep a clear idea of which controller is which inputs. If all that is manageable and you really want to avoid any coding, a product like A-PAC is probably a good choice.

    For X-plane, Teensy has a special Flight Sim Controls option which you select from Tools > USB Type in Arduino. Full documentation is here:

    https://www.pjrc.com/teensy/td_flightsim.html

    Obviously everything about using Teensy involves some programming. If you keep your hardware connection simple, just 1 pot per analog pin and 1 switch per digital pin, the programming is pretty simple and you can probably do is all by just copy-paste from examples.

    The nice advantage of using Flight Sim Controls is you can put your X-Plane Dataref names directly into the code on Teensy, so it will always associate each button or pot with the intended flight sim features regardless of what other USB devices are present or what order they're plugged and unplugged from your PC. The TeensyControls plugin for X-Plane even lets you unplug and reconnect (or reprogram with Arduino) with the simulator is running and it always automatically connects to the intended Datarefs before those names are baked right into the code you store on Teensy.

    Theoretically you could connect a huge number of analog inputs and switches by using hardware like analog mux chips and digital shift registers. But if you want to keep the code simple, and any troubleshooting of problems simpler, best to avoid those more complicated connections. You can use many Teensy boards simultaneously with X-Plane and TeensyControls and every input always controls the intended Dataref according to the code you loaded. If you do go down that road with multiple Teensy boards, and multiple programs in Arduino, it's simplest to program them by using Verify in Arduino and then physically press the button on the intended Teensy to initiate the programming... since from the menu in the software they all look the same.
    Thank you Paul! Lot of great information to parse there. I have reduced the number of analog inputs I need by converting some controls to buttons for simplicity here, so that is no longer a worry.

    It looks as if your Teensy X-Plane (FlightSimSwitches) library will function on any supported Arduino board according to this documentation: https://www.arduino.cc/reference/en/...htsimswitches/
    I'm currently testing it with a Mega 2560 that I have on hand. Any advice on that?

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    27,372
    FlightSimSwitches probably only works on Teensy. But I am not the author of that library. It was written by Jorg Neves Bliesener.

    The library's readme file which he wrote is probably a better source of info than Arduino's summary page which was automatically generated by a bot.

    https://github.com/jbliesener/Flight...ster/README.md

    But if you already have an Arduino Mega wired up, and time to test it, might as well give it a try.

  10. #10
    I see. I wonder what his library does differently than your X Plane library.

    You don't happen to know if your X Plane library will work with a standard Arduino board like my Mega do you?

  11. #11
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    27,372
    Teensy's USB flight sim controls does not work on Arduino Mega.

Posting Permissions

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