Try to build a flightsim button box (DCS, MSFS Etc)

Hi
Im new to Arduino. I understand the electrical part/wiring (I think, but i still have questions about it). But im new to the software/programing part.
My intension is to build a “buttonbox” that can be used in different flightsims. After a lot of research I guess the best option is to use an Arduino MEGA 2560; and use some code named “MEGAJOY”?
In my box I want to have the following:
1 joystick (for guiding bombs and locking round whit the gun turret)
5 rotary encoders whit buttons (quadrature encoder ?)
10 switches ON/OFF
10 switches ON/OFF/ON
10 buttons
Im thinking: 2 or 4 pins for the joystick; 3 pins for each rotory encoder x5; 7 pin for the ON/OFF ; 12 pins for the ON/OFF/ON; 7 pin for the button = 45 pins ?
Max 26 digital pins for buttons, ON/OFF/ON and ON/OFF ? Can I use any digital pins for the buttons? 22-53? (se the image)

Rotary encoders need 3 pins (except + and -) 3 digital pins?
On the joystick im lost on what pins it needs, I would like the joystick to be sensitive to how much you move it in a certain direction. For example moving a little to the left gives full left direct (not ideal).
Is it possible to program all this in to one MEGA 2560 and to get windows to recognize all the buttons, switches, rotary encoders and the joystick ?
I have no clue if this even is possible, because I have not found anyone doing a box whit all this. Is it possible? Without delay issues or likewise. For me this is the ultimate flighsim buttonbox.
Then is it plausible that I will be able to “copy/paste” a code to get this running ?

I'm a newbie so please take my comments with a pinch of salt.

  1. I'd rather start with something simpler. Get a breadboard, a small arduino and play with the individual components you want to implement in your full project.
  2. For the analog joystick, no problem at all, but you need to use the analog pins of the arduino (they are more limited than the digital ones --actually the analog ones can work as digital, but the opposite is not true--).
  3. You shouldn't experiment any delay, unless you start doing complicate things in code. And since you are using for simulator controls (not the main joystick, gas or pedals), it should always be fine.
  4. Number of pins: You could reduce the number by using a matrix system for some of your buttons and switches (e.g. for 16 buttons you can only use 8 pins --4x4=16--) You only need to use diodes and somethign similar to.

https://www.gammon.com.au/images/Arduino/Keyboard%20Matrix1.png

But, again, I recommend you to start experimenting with something smaller using a plain breadboard and then start building up from there.

Regards

There are a couple of current threads here about building cockpits for flight sims. One of them is using DCS bios to talk to the sim, so it's certainly plausible.

Last time I looked at the MSFS, the SDK hadn't been finalized, so I don't know how you would talk to it. You might use a Leonardo or one of the other Arduinos that can emulate a USB keyboard and have that send keystrokes for the Mega.

There are other sims that use UDP to communicate with external hardware, but to use that you would need ethernet or wifi capability.

I'm not familiar with MegaJoy.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.