Results 1 to 8 of 8
  1. #1
    10+ Posting Member
    Join Date
    Apr 2016
    Location
    Germany, Bavaria, Munich
    Posts
    12
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    How many buttons are conectable to one Arduino Mega?

    Hello,

    I want to use the Link2FS for FSX or FS9 with my homepit. As it is mainly for other simulators than for the MSFS, I only use the input function for switches, buttons or rotaries.

    At first I want to use the program "Link2FS Arduino Keys" for this, but you could only connect one modul to one running instance of it. Link2FS FSX or FS9 has the option to connect more modules to one running instance of it.

    I have asked Jim if I could use it for any simulator as a simple switch to keyboard emulator, and he told me that its not necessary to run it with MSFS. You get an error message, but after ignoring this, it is able to sent keyboard emulation to any program which is in focus. So I could use it for my project.

    The only thing I couldn't find is, how many simple push buttons are connectable to one Arduino Mega R3 module?
    In the case of his other software, the one I want to use first (Link2FS Arduino Keys), there is a information about that you could connect 66 buttons to it. Haven't found such an information for Link2FS FSX/FS9 or Link2FS Expert FSX/FS9.

    Could anyone told me how many simple push-buttons are connectable?

    Many thanks

    Sven

  2. #2
    150+ Forum Groupie
    Join Date
    Nov 2013
    Location
    Evansville, Indiana
    Posts
    218
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: How many buttons are conectable to one Arduino Mega?

    Sven,
    54 digital pins plus 16 analog that can be converted to digital minus 2 pins for (pins 0 and 1 usb send/receive) and minus 1 for (pin 13 the led pin)

    So 67 pins, I think.
    67 buttons.

    The 300 level class:
    You can chain multiple Arduinos together using i2c protocol (Wire Library) using 2 pins on each arduino.
    So, Arduino 2 can tell Arduino 1 that button x has been pressed. Then Arduino 1 can send the command to the PC.

    The 400 level class:
    Arduino Leonardo and Arduino Micro can be configured to act as a USB Keyboard, Mouse or Joystick.
    The "Joystick" can send info for XYZ axis, XYZ axis rotation, Rudder, Throttle, 2 POV Hats, and the most important 32 buttons.
    You can set it up as Joystick with buttons only. You don't need to use the axis.
    There are a few libraries, one of which can act as 3 joysticks from one Leonardo or Micro. That's 96 buttons.

    Now, the Leonardo and Micro don't have 96 pins....But you can use the i2c Wire Library (mentioned above) to add a Mega or 2 to the Leonardo or Micro.

    Remember you also can use them as a Keyboard, if you only need key bindings.

    ~Fess
    Last edited by Fess_ter; 10-01-2016 at 04:33 PM. Reason: Typos
    I will only ever be, half the Geek that I wished I was.
    TheGeekForge.Com

  3. #3
    New Member
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    3
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: How many buttons are conectable to one Arduino Mega?

    Check my post on how to build cheap 128 input DX interface using Leonardo and 8 MCP23017 expanders.
    http://www.mycockpit.org/forums/showthread.php?t=30867

  4. #4
    10+ Posting Member
    Join Date
    Apr 2016
    Location
    Germany, Bavaria, Munich
    Posts
    12
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: How many buttons are conectable to one Arduino Mega?

    Many thanks for your answers,

    the 67 buttons for one Arduino Mega are enough for my projekt. If I can use 5 Megas with one instance of Jim's expert software, that's 67 x 5 = 335 functions for keyboard macros.

    Have looked at another Arduino cockpit software, but there were only 40 digital inputs possible and that's too little.

    Sadly I must go the keyboard emulation way and couldn't use DX buttons, cause I use the pit also for a few older simulators, which aren't able to use more than 32 DX buttons.

    Regards Sven

  5. #5
    New Member
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    3
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: How many buttons are conectable to one Arduino Mega?

    Quote Originally Posted by Viper1970 View Post
    Sadly I must go the keyboard emulation way and couldn't use DX buttons, cause I use the pit also for a few older simulators, which aren't able to use more than 32 DX buttons.
    The Arduino code I posted can be easily alerted so one can have 4 joystick with 32 DX inputs each instead of one with 128.

  6. #6
    10+ Posting Member
    Join Date
    Apr 2016
    Location
    Germany, Bavaria, Munich
    Posts
    12
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: How many buttons are conectable to one Arduino Mega?

    Hello sandb0x,

    yes I know that you can go this way, but sadly most older sims like the old Jane's series don't like more than one joystick. You could be happy if they support an USB-joystick at all .

    Since I have a really huge collection of flight and combat sims, and in case of my earlier working life, never had the time to use them, I will catch it up now.

    For this purpose I have two PC's in my pit. The one for this old stuff is running W98 and has an old Voodoo SLI system and a 6800GT AGP for the graphics. Most old sims are able two use USB-joysticks, but only one stick at the same time. Those early days the only way for building a homepit was to use a hardware, which was able to emulate keystrokes.

    The really hard part of my project is to get those old sims running, but however built a pit which is able to support modern sims like e.g. Falcon BMS with all of its avionics, too.

    If you use only Falcon BMS or the MSFS there are much more options to built a home cockpit, but if you want to do a "universal pit" its a real pain. I was already thinking about giving up a few times, but its the dream of my last twenty years.

  7. #7
    New Member
    Join Date
    Aug 2016
    Location
    Sweden
    Posts
    4
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: How many buttons are conectable to one Arduino Mega?

    I've not tested this myself, but there's a thing called voltage ladder that makes it possible to have several buttons on one single analog pin. Here's a forum thread where you can find some useful information:
    http://electronics.stackexchange.com...gle-analog-pin

  8. #8
    150+ Forum Groupie


    BushPilotWannabe's Avatar
    Join Date
    Jan 2014
    Location
    Alberta, Canada
    Posts
    153
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: How many buttons are conectable to one Arduino Mega?

    Good suggestion. I'm running 29 switch/resistor pairs on one analog pin including three rotary encoders, scaled down from 8 quadrature encoders and eighteen pushbuttons. The encoder pushbuttons - not included in the switch count - were used to change the analogRead level for its respective encoder and add a second function to the encoder.

    Disadvantages:
    Only one switch can be closed at a time unless it is a very short ladder. Pushing two switches at the same time shorts out one or more resistors changing total circuit resistance in essentially a multiple voltage divider application. One or more switch combinations are available but as the number of resistor/switch pairs increase the analogRead levels increase and start to overlap. One stuck switch can shut down the ladder. Copilots: wheels up, flaps up, shut up, and keep your hands to yourself.
    Two or more analog pins read consecutively may not stabilize enough to be usable. Something about using one ADC for all the analog pins. Solution is to read the same pin three or four times in a row and and only use the last read for input. Total processing time for each pin is around 500 microseconds. The lag for each pin is barely noticeable with human input.
    The analog pin is voltage sensitive. Loose components or wiring will produce random changes to circuit resistance and resulting voltage. Inexpensive Dupont connectors are more than enough to ensure stable circuits; however, a bad solderless breadboard or pushbutton should be kept for digital circuits. Using a ground plane goes a long way to eliminating transient induced voltages.

    Advantages:
    One comparatively slower read of a pin can test many switches and if a procedure like Jimspage.co.nz INPUTPINS() is used, the circuit needs no debouncing. A call to read an analog pin with no switches closed - or a switch held down - can return to caller in 160 microseconds or so.
    Additional pushbuttons will require an additional resistor and three lines of code plus code to perform associated output. Plus of course, re-recording the input level for every ^%$$ switch every time there is a change to the electrical circuit until the project is finished. Then, day in day out, turn on the power and use.

    The sample circuit does not show a pull up or pull down resistor required to keep the input from floating when no switch is closed. Suggest a resistor in the range of 100k to 1M ohms connecting the analog pin to the power rail associated with the voltage (analogRead level) you use to indicate all switches open.


    Hugh
    ---CYXD ----- TWR --- GND ------ Closed
    ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013