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 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
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
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...