Button Box make by beginner

Hi, I’d like to build my first button box. I have very little knowledge about this, so I need your help to do it properly. I’ve designed a layout with the buttons shown below. I have no idea which board I should buy for it exactly (I only know that a lot of people use the Arduino Micro Pro, but I’m not sure if it will be suitable in this case), and I would need some kind of diagram showing how to connect everything and how to code it correctly so that it will work in games.

I’m counting on your help, thanks!








  • What will you use this for ?

  • Search this web site.

  • Google Arduino matrix switches.

I would like to use it to connect by usb with PC and play in Euro Truck Simulator 2, sorry but Im beginner in this kind of things, but I really would like to make it by myself

You may want to give this a read. Plenty of good forum info on buttons.

When using buttons or switches you need to be aware of what we call switch bounce and how to address it in your code.

Detecting buttons and switches is relatively easy. Read the link I posted.

Ron

Start by just googling key words associated with what you are interested in. From what you have posted I have no idea what you are trying to do.

I would like to make a button box for PC games, yeah I gonna read this what you sent me and thank you, maybe then will be easier :smiley:

One way to handle 18 buttons is to wire them in a matrix, but as you will have several buttons closed at a time you will have to take care of "ghosting".

If you want to go for it this page will give some hints

https://www.baldengineer.com/arduino-keyboard-matrix-tutorial.html

And this link provides information how to turn a Leonardo or Pro Micro into a joystick emulator

https://www.instructables.com/Arduino-LeonardoMicro-as-Game-ControllerJoystick/

You should check - if you haven't up to now - which kind of HID (human interface device) is supported by the Euro Truck Simulator 2.

Be aware that this is not really a beginner's project...

Anyway, good luck!
ec2022

[Edit] You may find video clips on YouTube where the buttons are wired without the use of diodes to prevent ghosting. In a matrix this is only safe if you are very sure that never three or more buttons will be pressed/switched on at a time! This is usually what you can expect for a number keyboard. Once you have a configuration where three buttons are pressed that are placed in a rectangle wiring shape (see the link above on ghosting) the software cannot detect the correct situation...

I'll try to offer my own small contribution to the request. If the main problem is how to connect the switches and read their status, perhaps this old project of mine for a Flight Simulator X panel (for a B737) might give you some ideas:

Obviously, the type of connections and management depend on how many and which of these can be activated simultaneously, but take a look at my previous project, where I manage 14 switches and 2 rotary switches using only a small Arduino Nano...