Sting57 Posted August 24, 2021 Share Posted August 24, 2021 Hi just trying to setup the ASPJ swtich on the hornet ECM panel. I have my rotary switch all wired up I am using the following code from DCS BIOS const byte ecmModeSwPins[5] = {3, 8, 9, 11, 13}; DcsBios::SwitchMultiPos ecmModeSw("ECM_MODE_SW", ecmModeSwPins, 5); However the switch does not work. ( I have checked the controls and have no other buttons mapped to the ecm mode switch. I have tested the switch on other functions (RADAR, DDI switch etc) and it works fine, so I know my wiring is all good. Any idea's on why I am having issues with the above code? Has DCS changed the naming of the function, if so how would i check? Thanks Sting Win11 64bit, AMD Ryzen 58003DX, GeForce 3070 8GB, 2TB SSD, 64GB DDR4 RAM at 3200MHz _ full 1:1 FA-18C Cockpit https://www.youtube.com/@TheHornetProject Link to comment Share on other sites More sharing options...
No1sonuk Posted August 24, 2021 Share Posted August 24, 2021 DCS doesn't control the name of the function. AIUI, DCS-BIOS has a "lookup table" where it converts the name you use to an address and reads or writes to that address as appropriate. That should remain the same unless you've update DCS-BIOS or the arduino library for it. I would suggest setting up a completely separate arduino with just that function in it in order to test if any of your other code is interfering. Isolate it entirely Link to comment Share on other sites More sharing options...
Sting57 Posted August 24, 2021 Author Share Posted August 24, 2021 (edited) it is the only piece of code in the sketch. I wonder than if that internal "lookup table" has not been updated to the new switch? Edited August 24, 2021 by Sting57 Win11 64bit, AMD Ryzen 58003DX, GeForce 3070 8GB, 2TB SSD, 64GB DDR4 RAM at 3200MHz _ full 1:1 FA-18C Cockpit https://www.youtube.com/@TheHornetProject Link to comment Share on other sites More sharing options...
DeadMeat Posted August 25, 2021 Share Posted August 25, 2021 LUA references for switches sometimes change with DCS updates. The ASPJ rotary and some of the ECM toggles changed recently it seems, so check that you have the latest version of the DCS-BIOS hornet module. My mods --> Mil-spec upgrades for TM Warthog, Hornet & Cougar grips | Mil-spec upgrade for TM Warthog throttle | Real Tornado gear switch modded into gear and hook lever switches Link to comment Share on other sites More sharing options...
Sting57 Posted August 25, 2021 Author Share Posted August 25, 2021 (edited) Ok just incase someone else finds this. The Hornet plugin for DCS Bios is out of date with DCS. To fix this issue: I edited this file (the hornet plugin for dcs bios) C:\Users\XXXXXXX\AppData\Roaming\DCS-BIOS\Plugins\module-fa-18c-hornet\FA18-C_hornet.lua I changed this line defineTumb("ECM_MODE_SW", 0, 3116, 248, 0.1, {0.0, 0.4}, nil, false, "Dispenser/EMC Panel", "ECM Mode Switch, XMIT/REC/BIT/STBY/OFF") to this defineTumb("ECM_MODE_SW", 66, 3001, 248, 0.1, {0.0, 0.4}, nil, false, "Dispenser/EMC Panel", "ECM Mode Switch, XMIT/REC/BIT/STBY/OFF") And that is it. This is the post that helped. So Thank you BlackLibrary!!! Edited August 25, 2021 by Sting57 Win11 64bit, AMD Ryzen 58003DX, GeForce 3070 8GB, 2TB SSD, 64GB DDR4 RAM at 3200MHz _ full 1:1 FA-18C Cockpit https://www.youtube.com/@TheHornetProject Link to comment Share on other sites More sharing options...
Trigger357 Posted December 21, 2021 Share Posted December 21, 2021 is it even possible to use Multiplexers with DC-BIOS???? does anyone have a working example? here is my sketch but its giving oscillation to the virtual cockpit buttons. i think the readpanel() function is causing the MCU to write to the Tx pin and causing my problem so I need to make an if condition and compare anew state to the old state. fa18_simpit.ino Link to comment Share on other sites More sharing options...
Recommended Posts