neetz Posted August 26, 2017 Share Posted August 26, 2017 Hello all. I want to (test) build an panel for simplifying the use for some of the buttons we regularty have to look at, grab a mouse and press accordingly. For my first project ive selected the Mirage 2000 and I think, it makes sense to build it on Leo Bodnar BU0836X board. This will have more options for me, for future builds. So, here comes the first question and ofcourse, its about buttons. For the mirage (eg formation) lighting we have 3 steps - 'Off - Dim - On' - and we can map all three stages on the keybind page. So, I think the button i need to usea for the lights has to be 'ON-ON-ON' styled switch, correct? OK, probably we can skip the Dim part of the switch but this question will arise again for the buttons like radar lines (4-2-1) and scan range (60-30-15) and AAR ... so at some points 3 inputs from an switch is needed anyways. After eventully ive gathered all the info n switches i will 3d print an box to set it all up, gotta start somewhere. Looking forward to hear help from you all. Thanks, neetz. :smartass: Im so happy that I found DCS, the free time i might have had - gone :suspect: Link to comment Share on other sites More sharing options...
FragBum Posted August 30, 2017 Share Posted August 30, 2017 Have a look here, this should be supported as on off on (that's the physical switch function) so I assume you would have the device dim/off/on. basic connection diagram There may be other settings and script/macro to change the functionality. HTH I am also looking at some form of interface device for my pit build and currently looking at maybe the Leo Bodnar 836 or maybe just roll my own with an Arduino AT mega 2650 Control is an illusion which usually shatters at the least expected moment. Gazelle Mini-gun version is endorphins with rotors. See above. Currently rolling with a Asus Z390 Prime, 9600K, 32GB RAM, SSD, 2080Ti and Windows 10Pro, Rift CV1. bu0836x and Scratch Built Pedals, Collective and Cyclic. Link to comment Share on other sites More sharing options...
DeJohn Posted August 30, 2017 Share Posted August 30, 2017 neetz; Welcome to the forums and the world of simpit building. Over the years I have used many kinds of interfaces and all have their strengths and weakness'. Depending on how elaborate your pit is, you may use several types of interfaces. As far as switches, the easiest interface I've used is the Leo Bodnar series, both the BU0836X and BBI-32 are easy to wire up and are plug & play (meaning your computer see them as just another joystick). Now about switches and DCS. Don't worry about having to get specialty switches, you won't need them and if you do you'll only use 1-2 of them in your pit. Due to how DCS codes; almost all of the switches will be of the inexpensive off-on, on-off-on type, rotary switches and rotary encoders. DCS has done most of the switch programing for you. Basically switch positions have a value for what they do (ex. Off=0, On=1) in most cases. Even if you've never coded anything before, you'll find it easy to do in DCS. In your formation lighting ex. of (Off-Dim-On), you can use a standard 3 position on-off-on switch and make it work the way it does in game as off-on-on. If you need help getting your switches to function correctly I can show you how to do it. Link to comment Share on other sites More sharing options...
Mr_Burns Posted August 31, 2017 Share Posted August 31, 2017 You need to go into the home cockpits thread at the top of this one and look at this great thread: https://forums.eagle.ru/showthread.php?t=65998 Link to comment Share on other sites More sharing options...
neetz Posted September 9, 2017 Author Share Posted September 9, 2017 Hi all. Thank you for suggestions and tips. Most of the parts have arrived, let the games begin. Im so happy that I found DCS, the free time i might have had - gone :suspect: Link to comment Share on other sites More sharing options...
Mr_Burns Posted September 10, 2017 Share Posted September 10, 2017 Very xciting, my daughter asked me "why do you keep making those panels". Link to comment Share on other sites More sharing options...
neetz Posted September 10, 2017 Author Share Posted September 10, 2017 neetz; Welcome to the forums and the world of simpit building. Over the years I have used many kinds of interfaces and all have their strengths and weakness'. Depending on how elaborate your pit is, you may use several types of interfaces. As far as switches, the easiest interface I've used is the Leo Bodnar series, both the BU0836X and BBI-32 are easy to wire up and are plug & play (meaning your computer see them as just another joystick). Now about switches and DCS. Don't worry about having to get specialty switches, you won't need them and if you do you'll only use 1-2 of them in your pit. Due to how DCS codes; almost all of the switches will be of the inexpensive off-on, on-off-on type, rotary switches and rotary encoders. DCS has done most of the switch programing for you. Basically switch positions have a value for what they do (ex. Off=0, On=1) in most cases. Even if you've never coded anything before, you'll find it easy to do in DCS. In your formation lighting ex. of (Off-Dim-On), you can use a standard 3 position on-off-on switch and make it work the way it does in game as off-on-on. If you need help getting your switches to function correctly I can show you how to do it. Hello. Yes, please, thank you. That would be awesome. I will try out with different switches (some are apparently really "hard" to push, would need like 1kg base plate for it not to move around on my desk in the future. ________ Dont know from how many progress reports are considered as spam but first things connected and working, too. Nothing fried up so far. That rotary switch is taking up 4 button slots but worked good for radar controls. :smartass: Im so happy that I found DCS, the free time i might have had - gone :suspect: Link to comment Share on other sites More sharing options...
DeJohn Posted October 11, 2017 Share Posted October 11, 2017 (edited) neetz looks like you're coming along quite well. Funny you should mention your rotary switch. There is little trick when it comes to rotary switches that saves on the number of buttons, and gives you an extra spot on the interface card to use for two other switches. As an example I'll use your 4 switch rotary, you actually only need to use 2 positions, and still get 4 positions in game, you'll wire up positions 2, 3 (no need to wire position 1 & 4). Most switches have an on(down) value of 1 or -1 and an off(up) value of 0. In the case of rotary switches the values are different... Position 1 = 0, pos' 2 = 0.1, pos' 3 = 0.2 and pos' 4 = 0.3. What you do is let pos' 2 & 3 handle pos' 1 & 4 input, this saves two switches for each rotary use. This is accomplished because the coding of rotaries doesn't call for the off(or UP) state of a switch. So we add an up(or 0ff) value for switches 2 and give it the value of switch #1, switch 3 we give #4's value as an up(off). As an example I'll use the code for the Uh-1 VHF FM Radio Mode which has a 4 position rotary. {down = 3007, cockpit_device_id = 23, value_down = 0, name = _("VHF FM Radio Mode OFF"), category = _("VHF FM Radio Control panel"), }, {combos = {{key = "JOY_BTN1"}, }, down = 3007, cockpit_device_id = 23, up = 3007, cockpit_device_id = 23, value_down = 0.1, value_up = 0, name = _("VHF FM Radio Mode TR"), category = _("VHF FM Radio Control panel"), }, {combos = {{key = "JOY_BTN2"}, }, down = 3007, cockpit_device_id = 23, up = 3007, cockpit_device_id = 23, value_down = 0.2, value_up = 0.3, name = _("VHF FM Radio Mode RETRAN"), category = _("VHF FM Radio Control panel"), }, { down = 3007, cockpit_device_id = 23, value_down = 0.3, name = _("VHF FM Radio Mode HOME"), category = _("VHF FM Radio Control panel"), }, The text above in RED is the info we add to the code lines. The 'JOY_BTN' number will be what ever number you assigned them to on your interface card. Now I know what you're thinking...'won't exiting pos' 2 to pos' 3 send the value for pos' 1. The answer is yes, except that pos' 3 has an actual down value so it will over rides pos' 2's up value, same goes for pos' 3 going to #2. Hope this helps. DJ Edited October 11, 2017 by DeJohn Link to comment Share on other sites More sharing options...
hansangb Posted October 11, 2017 Share Posted October 11, 2017 Hmmm, interesting. Thanks hsb HW Spec in Spoiler --- i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1 Link to comment Share on other sites More sharing options...
neetz Posted October 20, 2017 Author Share Posted October 20, 2017 After being away for a while, a little update regarding the 3D printed test. As it appears most of the holes, meant for the buttons and stuff, need to be bigger, about 0,2mm - 0,5mm from the measured values. And big shoutout to DJ for the input. Will try that out. Thanks. See you soon! Im so happy that I found DCS, the free time i might have had - gone :suspect: Link to comment Share on other sites More sharing options...
neetz Posted November 23, 2017 Author Share Posted November 23, 2017 Hello. So, here come the first-timer questions: I get the idea behind it, makes sense and all but how do I reference all that to M2k cockpit? :helpsmilie: My .lua code (in username/saved games/DCS/config/input/M-2000c/joystick/BU0836X Interface 'lots-of-numbers' .diff.lua) looks nothing like the one you described. I know, its ok, but i dont even realize where to start adding the code. Mine, for example is as follows (just mapped the Radar Warm up on the second rotary switch): ["d3486pnilu3486cd11vd0.33vpnilvunil"] = { ["added"] = { [1] = { ["key"] = "JOY_BTN1", }, }, ["name"] = "Radar WARM UP", For reference the other commands to be used in the final code should be: Radar off: ["d3486pnilu3486cd11vd0vpnilvunil"] Radar warmup: ["d3486pnilu3486cd11vd0.33vpnilvunil"] Radar silenced: ["d3486pnilu3486cd11vd0.67vpnilvunil"] Radar on: ["d3486pnilu3486cd11vd1vpnilvunil"] Do I need to edit the same file or is there a different one for added commands? Soooo to start from somewhere.. hints and tips please. Actually i even don't have any idea about the cockpit_device_id etc.. :( Thank anybody who is willing to help. Cheers. ~n neetz looks like you're coming along quite well. Funny you should mention your rotary switch. There is little trick when it comes to rotary switches that saves on the number of buttons, and gives you an extra spot on the interface card to use for two other switches. As an example I'll use your 4 switch rotary, you actually only need to use 2 positions, and still get 4 positions in game, you'll wire up positions 2, 3 (no need to wire position 1 & 4). Most switches have an on(down) value of 1 or -1 and an off(up) value of 0. In the case of rotary switches the values are different... Position 1 = 0, pos' 2 = 0.1, pos' 3 = 0.2 and pos' 4 = 0.3. What you do is let pos' 2 & 3 handle pos' 1 & 4 input, this saves two switches for each rotary use. This is accomplished because the coding of rotaries doesn't call for the off(or UP) state of a switch. So we add an up(or 0ff) value for switches 2 and give it the value of switch #1, switch 3 we give #4's value as an up(off). As an example I'll use the code for the Uh-1 VHF FM Radio Mode which has a 4 position rotary. {down = 3007, cockpit_device_id = 23, value_down = 0, name = _("VHF FM Radio Mode OFF"), category = _("VHF FM Radio Control panel"), }, {combos = {{key = "JOY_BTN1"}, }, down = 3007, cockpit_device_id = 23, up = 3007, cockpit_device_id = 23, value_down = 0.1, value_up = 0, name = _("VHF FM Radio Mode TR"), category = _("VHF FM Radio Control panel"), }, {combos = {{key = "JOY_BTN2"}, }, down = 3007, cockpit_device_id = 23, up = 3007, cockpit_device_id = 23, value_down = 0.2, value_up = 0.3, name = _("VHF FM Radio Mode RETRAN"), category = _("VHF FM Radio Control panel"), }, { down = 3007, cockpit_device_id = 23, value_down = 0.3, name = _("VHF FM Radio Mode HOME"), category = _("VHF FM Radio Control panel"), }, The text above in RED is the info we add to the code lines. The 'JOY_BTN' number will be what ever number you assigned them to on your interface card. Now I know what you're thinking...'won't exiting pos' 2 to pos' 3 send the value for pos' 1. The answer is yes, except that pos' 3 has an actual down value so it will over rides pos' 2's up value, same goes for pos' 3 going to #2. Hope this helps. DJ Im so happy that I found DCS, the free time i might have had - gone :suspect: Link to comment Share on other sites More sharing options...
hansangb Posted November 24, 2017 Share Posted November 24, 2017 (edited) You don't actually modify the diff.lua files. It looks like it should work, but it doesn't. The diff files are created by DCS when you customize the controller with a non-default command. Start with this post https://forums.eagle.ru/showpost.php?p=2893725&postcount=104 and read another page or so. Until post 118 where I finally got it. All those numbers and commands referenced by DeJohn will make sense. Once you configured the LUA files, you use Controller setup to assign the rotary/button/switch in the game setting. I have a week off at the end of the year, and I'm hoping I can finally make my switch boxes. All my parts have been sitting there for about a year now :( I built a few prototypes with DerekSpeare's boards, GPWiz, and Bodnar boards. But never milled the parts with my MPCNC. Hopefully end of this year will be the ticket. Unless my wife says "let's go away for a week" LOL. Edited November 24, 2017 by hansangb hsb HW Spec in Spoiler --- i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1 Link to comment Share on other sites More sharing options...
neetz Posted November 24, 2017 Author Share Posted November 24, 2017 (edited) Sounds like to be sure, you need to send the wife away for a week :thumbup: Thats what i did.. but for 3 days :D Right, Sir, you are correct. All of it just might make sense. So all editing will be done inside the default.lua in the Game folder at DCS W / Mods / aircraft / M-2000c / input / M-2000c / joystick ? So basically i will "combo" the following: {down = 3486, up = 3486, cockpit_device_id = 11, value_down = 0, name = _('Radar OFF'), category = _('Sensors')}, {down = 3486, up = 3486, cockpit_device_id = 11, value_down = .33, name = _('Radar WARM UP'), category = _('Sensors')}, {down = 3486, up = 3486, cockpit_device_id = 11, value_down = .67, name = _('Radar STANDBY'), category = _('Sensors')}, {down = 3486, up = 3486, cockpit_device_id = 11, value_down = 1, name = _('Radar ON'), category = _('Sensors')}, Did a backup just in case, will look into it. :book: You don't actually modify the diff.lua files. It looks like it should work, but it doesn't. The diff files are created by DCS when you customize the controller with a non-default command. Start with this post https://forums.eagle.ru/showpost.php?p=2893725&postcount=104 and read another page or so. Until post 118 where I finally got it. All those numbers and commands referenced by DeJohn will make sense. Once you configured the LUA files, you use Controller setup to assign the rotary/button/switch in the game setting. I have a week off at the end of the year, and I'm hoping I can finally make my switch boxes. All my parts have been sitting there for about a year now :( I built a few prototypes with DerekSpeare's boards, GPWiz, and Bodnar boards. But never milled the parts with my MPCNC. Hopefully end of this year will be the ticket. Unless my wife says "let's go away for a week" LOL. Edited November 24, 2017 by neetz Im so happy that I found DCS, the free time i might have had - gone :suspect: Link to comment Share on other sites More sharing options...
neetz Posted November 24, 2017 Author Share Posted November 24, 2017 So, as far progression goes, seems like for at least for M2000c i tried to break through an open door. Razbam seems to have a bindings called '3-Pos. Switch Abstractions'. Under that section they have {down = 3486, up = 3486, cockpit_device_id = 11, value_up = 1, value_down = 0.67, name = _('Radar Standby, else ON (modified)'), category = _('3-Pos. Switch Abstractions')}, {down = 3486, up = 3486, cockpit_device_id = 11, value_up = 0, value_down = 0.33, name = _('Radar WARM UP, else OFF'), category = _('3-Pos. Switch Abstractions')}, I just swapped the settings for 'Radar ON, else Standby' with 0.67 and 1 and seems to work like a charm. Otherway around the controls got confused, by now, for obvious reasons but.. i'd just like to add that, thank you guys for replying and helping me on the right track. Things are looking good. :smartass: Im so happy that I found DCS, the free time i might have had - gone :suspect: Link to comment Share on other sites More sharing options...
hansangb Posted November 24, 2017 Share Posted November 24, 2017 awesome! have fun. And do check out the Home Cockpits subthread. Incredible builds there, for sure. hsb HW Spec in Spoiler --- i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1 Link to comment Share on other sites More sharing options...
DeJohn Posted November 25, 2017 Share Posted November 25, 2017 Hi neetz; Do not alter files in the game directory directly, if you know what I mean. You'll want to make copies of the file you want to edit, and then add them to the game as a mod. The reason for this is when DCS does an update, it varifies the game files first, checking to see that the modify date is the same as the one in the data base. If the date is different (as it would be if you edit it) the update will remove your edited file and replace it with thiers, deleting all the work you did. Here's how to edit and add your changes... First you'll need a few programs... Notepad ++ (never use windows notepad, it can't retain the format data), you'll also need a mod installer program like OVGME or JSGME. I currently use OVGME since JSGME (while still working) hasn't been updated in years. You can get it here https://forums.eagle.ru/showthread.php?t=171956 Next we need to setup our work area, this only takes a short time to do but will same you alot of time down the road. On your desktop make a folder named DCS Inputs. Inside that you'll make two folders, Original and MyInputs. Now goto the game folder with the aircraft you intend to edit. In this case DCS W / Mods / aircraft / M-2000c / input /. Copy the M-2000c folder (which should have the folders joystick & keyboard inside, and paste a copy in the Original folder and MyInputs folder you made. The reason for this step... **some might say the original folder isn't necessary but here is why I do it this way.... Lets say the file we're editing is the default.lua file and its modification date is 7-10-17. At some point you'll start DCS and the update window will pop up. Don't click anything on that window, insted you'd open OVGME and un-install all mods you added to the game. Once done, then you'll let DCS update. When the update is done and DCS starts you'll shut it down. Now we open the Original/M-2000c/joystick folder and look at the date modified of the default.lua, (7/10/17). Then open the folder in in game directory and verify the file date to see if there were any changes to it. If the dates are the same then you're done with this step, and can re-install your mods. But, lets say the file has an updated date of 11/26/17, that tells us DCS made a change in the file and we need to compare them to see what changes if any need to be made to our edited file. The comparison can be done with Notepad ++, it will show us what alterations we need to make to our moded file.** Moving on... Open the MyInputs/M-2000c/joystick folder, copy and paste a copy of the file you're going to edit. (I usually use the Joystick - HOTAS Warthog.lua, since these joystick files are used for actual joystick buttons, rather then the default.lua which is more akin to keyboard inputs), but use either one you want. Next rename the copied file to CleanInput.lua, open it with notepad++, go down the lines of code and where ever you find the Combos entry say... {combos = {{key = "JOY_BTN5"}, }, down = 3486, up = 3486, cockpit_device_id = 11, value_down = 0, name = _('Radar OFF'), category = _('Sensors')}, remove the combos command so that they read as... {down = 3486, up = 3486, cockpit_device_id = 11, value_down = 0, name = _('Radar OFF'), category = _('Sensors')}, Once you have removed all the combos commands, save the file. (this makes a fresh copy to start with if you add more interface cards in the future). Ok now that setup in done, time to edit. Make a copy of your CleanInput.lua and name it Button Box Interface (if you've changed the name of the card use that). NOTE.. if you have a diff file of your card in your saved games input folder delete it as the diff files will override anything in your edited file. Open your 'Button Box Interface.lua file, move down to the line you want to edit and do so. (remember once you edit a line and are happy with your change, click the save icon at the top of notepad++, just incase something happens, you won't have to start your editing all over). Okay, you've done the editing you want to do for now and saved the file, so its time to make it a mod so you can install/uninstall to the game. This is done by making a folder tree for the mod. You can make this tree manually by creating each subfolder one at a time or do it the easy way, which is, with your edited file open in notepad++, click file, save as.. Now you can navigate to your ovgme mods folder. (my case its E:\OVGME\DCS Mods) your's will most likely be different. Then on the file name line enter... MyDCSInputs\Mods\aircraft\M-2000c\input\M-2000c\joystick\Button Box Interface.lua and click save. Now all you have to do is open OVGME and click the mod to install to the game. Now Remember!! before making any changes to your mod files uninstall them from the game or any changes you make will not be permenant and you'll have to do it again. DJ Link to comment Share on other sites More sharing options...
neetz Posted December 6, 2017 Author Share Posted December 6, 2017 Thanks for the tips. I have completed the layout for now. In perfect world it should cover most of the things that need to be pressed. 32 buttons total, including: 3 * two way switches 2 * two way switches with LED indicator 7 * three way swiches 2 * rotary encoders w/ push button 1 * rotary switch w/ 4 positions 5 * push buttons // i hope my math is correct (Box facing the backside at front) The parts will be sent to print, and i can start building the MOD profile meanwhile. Sounds good. Im so happy that I found DCS, the free time i might have had - gone :suspect: Link to comment Share on other sites More sharing options...
hansangb Posted December 6, 2017 Share Posted December 6, 2017 Make sure you post some pics when you've completed them! hsb HW Spec in Spoiler --- i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1 Link to comment Share on other sites More sharing options...
Recommended Posts