Sickdog Posted December 23, 2019 Share Posted December 23, 2019 Hi guys, I have some guarded switches I want to use with my Hornet DCS-BIOS desk-VR-pit and just noticed that DCS-BIOS has its own commands to lift the guard, separate from the actual switch toggling. I have some simple guarded ON/OFF SP switches I purchased from Amazon: https://www.amazon.com/dp/B07QKFD7Z7/ The question I have is does anyone have any good solutions to bypass the need to have an input for the lifting of the guard itself? I feel it’s sort of redundant and wish I could have the physical switch toggle/input both lift the guard and flip the switch in game. I tried to give both commands to the same pin in my arduino sketch but that didn’t work. Would a programmed delay (if possible) work? I thought about trying to install a push button that is activated by the guard but that seems too complicated and won’t look good. Appreciate any input here! Thanks! TM Warthog, Oculus Rift, Win10... Link to comment Share on other sites More sharing options...
jrsteensen Posted December 23, 2019 Share Posted December 23, 2019 This definately seems to be one of those items that should have a software solution vs having to wire extra switches. If it was an exclusively hardware pit I'd say to send a command to raise all the guards when you load in, but that wouldn't work so well for VR. Sent from my SM-G960U using Tapatalk OpenHornet F/A-18C 1:1 SimPit Website :: DCS Thread Link :: Discord :: Github :: Link to comment Share on other sites More sharing options...
JG14_Smil Posted December 23, 2019 Share Posted December 23, 2019 https://forums.eagle.ru/showthread.php?p=4145041#post4145041 There is info on how to do this in DCS in this link. I am not sure if there are any other new approaches to the problem. Editing the mainpanel_init file, I believe. Link to comment Share on other sites More sharing options...
Hansolo Posted December 23, 2019 Share Posted December 23, 2019 I guess it should work if your activation of the switch first sends the command to lift the guard, a small delay followed the activation command. Alteratively you may use a MON-OFF-ON switch, so that the MON function is activated when the guard is down, once guard is being lifted the MON releases and send the command to DCS for lifting the guard, then activation of the ON send the command for aactivation of the function. I did this based upon advice from Deadman in this post and it works great; https://forums.eagle.ru/showpost.php?p=3411577&postcount=196 Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album Link to comment Share on other sites More sharing options...
Sickdog Posted December 24, 2019 Author Share Posted December 24, 2019 Hans, Thank you for both your suggestions. I read that link and definitely a great hardware solution to this dilemma. I think I’ll first try to see if I can figure out how to send a delay and code this solution, hopefully there’s some good discussions out there or arduino tutorials on how to do it! I’ll post back here if and when I find a coding solution to this. I’d rather not have to dismantle my panels I just finished and replace with new switches! Haha. TM Warthog, Oculus Rift, Win10... Link to comment Share on other sites More sharing options...
Ranma13 Posted December 24, 2019 Share Posted December 24, 2019 There are bindings in DCS BIOS for the switch covers for the F/A-18. If it's anything like the Ka-50, you can bind to the switch itself and flip it twice (first time will raise the cover, second time will activate the switch), or you can simply send one action after the other without needing a delay. There's nothing built into the DCS BIOS Arduino library that can do this, but ultimately the library is just a wrapper that sends serial messages, so you can detect when the button state has changed, then send the message to raise the cover, then immediately send the message to activate the switch. Link to comment Share on other sites More sharing options...
punk Posted December 24, 2019 Share Posted December 24, 2019 (edited) Hi Pukin' Dog (Sorry, I like naval aviation too much and your avatar fits the name :smilewink:), I have no idea how any of the software fixes work as of yet, but like the esteemed Mr. Solo, I will offer a couple fairly simple mechanical solutions for the missing action. I do like the simplicity of the On-Off-(On) solution, but find those switches higher priced, a little more difficult to obtain, and they do not quite solve the issue when the guarded switch has three functions resulting in this same problem. One option is to use reed or hall effect switches attached under the mounting or face plate with small magnets attached or inset into or under the guards. I have not used this yet, but I have the parts now and will begin experimenting eventually. In theory, they should act something like a refrigerator light switch or a window alarm system. A second option, do as Craig S does using a small pushbutton switch placed at the rear of the switch guard. As the switch guard is flipped into the open position, it pushes down the momentary switch and holds it in place until closed. Here is a link to his project website: http://mysimpit.co.uk/ He addresses the issue around 11:55 in his YouTube video. Hope these give you more options to think over. Best of luck on your build. Salute, Punk Edited December 25, 2019 by punk Punk [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
Sickdog Posted December 27, 2019 Author Share Posted December 27, 2019 There are bindings in DCS BIOS for the switch covers for the F/A-18. If it's anything like the Ka-50, you can bind to the switch itself and flip it twice (first time will raise the cover, second time will activate the switch), or you can simply send one action after the other without needing a delay. There's nothing built into the DCS BIOS Arduino library that can do this, but ultimately the library is just a wrapper that sends serial messages, so you can detect when the button state has changed, then send the message to raise the cover, then immediately send the message to activate the switch. Thanks Ranma- I like your idea of just sending one action after another. I might try that first and see how I like it, but I’m sure at some point for the sake of realism (that’s what this is all about, right guys? Haha) I might try other solutions that detect the cover being lifted. Sorry to ask here but can you (or anyone) direct me to a good source to learn from or examples of this code? I’m relatively new to arduino coding (tho I have some general coding experience) and not sure how to send one action after another. I’m guessing it’s some lines of code in the “loop” section that has an IF statement? Thanks for any assistance on this!! TM Warthog, Oculus Rift, Win10... Link to comment Share on other sites More sharing options...
Sickdog Posted December 27, 2019 Author Share Posted December 27, 2019 Hi Pukin' Dog (Sorry, I like naval aviation too much and your avatar fits the name :smilewink:), I have no idea how any of the software fixes work as of yet, but like the esteemed Mr. Solo, I will offer a couple fairly simple mechanical solutions for the missing action. I do like the simplicity of the On-Off-(On) solution, but find those switches higher priced, a little more difficult to obtain, and they do not quite solve the issue when the guarded switch has three functions resulting in this same problem. One option is to use reed or hall effect switches attached under the mounting or face plate with small magnets attached or inset into or under the guards. I have not used this yet, but I have the parts now and will begin experimenting eventually. In theory, they should act something like a refrigerator light switch or a window alarm system. A second option, do as Craig S does using a small pushbutton switch placed at the rear of the switch guard. As the switch guard is flipped into the open position, it pushes down the momentary switch and holds it in place until closed. Here is a link to his project website: http://mysimpit.co.uk/ He addresses the issue around 11:55 in his YouTube video. Hope these give you more options to think over. Best of luck on your build. Salute, Punk Haha- I’ve definitely had that same thought when I fly the Puk’n Dogs livery in the tomcat, so no apologies! Thanks for the reply. I definitely like the solution you referenced in the video... I might try that if I decide the coding method feels like I’m cheating or want more realism. TM Warthog, Oculus Rift, Win10... Link to comment Share on other sites More sharing options...
punk Posted December 28, 2019 Share Posted December 28, 2019 Haha- I’ve definitely had that same thought when I fly the Puk’n Dogs livery in the tomcat, so no apologies! Thanks for the reply. I definitely like the solution you referenced in the video... I might try that if I decide the coding method feels like I’m cheating or want more realism. I will try different methods myself as I close in on that portion of my build. Either way you go, I can not see how any of them are "cheating." In the real world, lifting the switch cover usually does not trigger an action, though there are exceptions of course, but it is a safety measure not to move the switch by accident. So how is it a cheat at all to have to add a step which is not really missing? You are just telling the computer the action is taking place. Salute, Punk Punk [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
Sickdog Posted December 28, 2019 Author Share Posted December 28, 2019 I will try different methods myself as I close in on that portion of my build. Either way you go, I can not see how any of them are "cheating." In the real world, lifting the switch cover usually does not trigger an action, though there are exceptions of course, but it is a safety measure not to move the switch by accident. So how is it a cheat at all to have to add a step which is not really missing? You are just telling the computer the action is taking place. Salute, Punk Haha, well, by saying I’m “cheating” I’m using it tongue in cheek in the sense that I feel like I’m cheating using a software solution when it would be cooler and more realistic to use a hardware solution, such as the one you referenced in the link/video. And yes, fully aware of the purpose of the safety switch as I’m a corporate pilot in real life with a few of these safety switches in the cockpit of the plane i fly. Thanks again for the help! TM Warthog, Oculus Rift, Win10... Link to comment Share on other sites More sharing options...
Puma Posted April 1, 2022 Share Posted April 1, 2022 Sorry I’m late to this. The dcs-bios arduino flightpanels fork has a solution where one pin can control both a cover and a switch and does the sequencing for you. https://github.com/DCSFlightpanels/dcs-bios-arduino-library For example: // A switch that has a cover in DCS that must be opened before the switch itself can be activated DcsBios::SwitchWithCover2Pos pltLaunchbarAbort("PLT_LAUNCHBAR_ABORT", "PLT_LAUNCHBAR_ABORT_COVER", 6); Custom Pit 476 Recruiting i9-12900KF, 32 GB DDR5, Gigabyte Aorus Z690 Master, Gigabyte RTX 2080 Ti, 1TB Sabrent Roket 4+ 2x750GB RAID-0, TrackIR 5 /w clip, CRG9 49” Curved Ultrawide Flight Display+15" Touchscreen+17" Gauges display, Thrustmaster Warthog+7.5cm, Saitek Pro Combat Pedals, Streamdeck, Butt Kicker and pneumatic G-Seat Link to comment Share on other sites More sharing options...
Recommended Posts