Jump to content

Built A10C AHCP panel and struggling to assign toggle switches


Recommended Posts

Posted

Hi guys,

 

I haven't ordered laser cut & engraved plexi panels just yet but I could not wait and wanted to try and build my first panel. A10C AHCP is really easy especially when using BU0836X controller. My first attemp was cardboard and I have already realised that it is too soft for the application. Never mind that. I was searching and reading this forum in order to understand how to bind toggle switches. Found that Helios is very simple way. Done it. It works. Apart from one thing - "Synchronize cockpit controls at startup" seems to work in it's own strange way. All toggle switches are not in the same position in VC as they are on my hardware panel. But enough of that - I'd like to bind my toggle switches within default.lua and this is where I got stuck. With the help of this forum I managed to get ON-OFF switches to work by adding

 

up = iCommandPlaneAHCPTGPOnOff,

to existing

{down = iCommandPlaneAHCPTGPOnOff, name = _('TGP switch ON/OFF'), category = _('Armament HUD Control Panel')},

But I struggle with ON-OFF-ON toggles. So far reading forum hasn't helped me even though I'm not giving up. It cannot be that complicated can it?

Please, can anybody help me with this?

 

Also I was not sure either I should make changes to my default.lua in (D:\DCS World\Mods\aircraft\A-10C\Input\A-10C\joystick)

 

or BU0836X Interface {E1881150-ACB0-11e4-8001-444553540000}.diff.lua

in C:\Users\JF\Saved Games\DCS\Config\Input\A-10C\joystick

 

Quite frankly I'm not familiar with programming at all and I struggle understanding this.

 

Thank you.

 

Regards,

Janis

Posted

I see you have an interface board already so this might not mean too much at the moment but why don't you look into DCS-BIOS to deal with this problem. Its the first sticky in this section.

 

I am amazed at how easy it is to setup commands very much like what your trying to accomplish except its stupidly easy to do. So much so that I am rebuilding my cockpit with BCS-BIOS and Arduino boards and dumping all my old interface boards.

 

I just thought you might be interested looking at a new and easier way. Using lua is not my idea of having fun.:pilotfly:

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Posted

agreed. Dcs bios is awesome. Second best is to emulate a USB hid joystick and connect switches as joy buttons and then map either in Helios or directly in dcs.

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

 

Forums Signature V4_500x100_20220716.png

Forums Signature V4_500x100_20221002.png

Posted

oh, and yes "sync to pit" does nearly nothing. There is a good reply from gadroc why, but basically it is dangerous in case of air starts, and technically challenging for multiposition switches.

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

 

Forums Signature V4_500x100_20220716.png

Forums Signature V4_500x100_20221002.png

Posted

Thanks Puma, I am using a USB HID (Leo Bodnar). I did map them via Helios fine. As from within DCS - I can't find a way to map them so they work properly, hence I'm asking the questions in my first post.

 

Warhog,

Thank you for the advice. I have seen and read through DCS BIOS sticky some time ago and yes I found it very interesting but also challenging for my little brain :) It's already been a very steep learning curve from knowing nothing to push myself and buy switches and Leo's board and getting it all to work. I do agree that Arduino looks easy. I might use that in future projects (panels) once I gain more knowledge. For time being I think USB HID is a good start - just want to understand how to modify lua scripts to get them work.

 

Thank you.

Regards,

Janis

Posted

Default lua will get overwritten by updates so if you enjoy putting it in over and over go ahead personally I don't change anything in DCS main folders anymore it is to much of a pain when it updates.

AMD A8-5600K @ 4GHz, Radeon 7970 6Gig, 16 Gig Ram, Win 10 , 250 gig SSD, 40" Screen + 22 inch below, Track Ir, TMWH, Saitek combat pedals & a loose nut behind the stick :thumbup:

Posted

Ian,

 

I guess I'll have to spend more time learning about Arduino and DCS-BIOS then. Can you advise what would be the very basic Arduino card for this process? Is MEGA 2560 good enough? I imagine it probably all depends on how many inputs/outputs I need right?

Posted

I have a radio stack plus extra switches done on a Mega and DCS-BIOS it includes 2 lcd screens for the freq one of the displays also has the digital clock displayed on it, all the knobs work the radios and I have used dual colour leds for a Gear indication off=up red = moving & green = down and locked.

I have no electronics experience or coding programming skill so yes it was a learning curve but I actually found it easier than helios and anything I had a problem with IAN was very helpful and patient with my stupid questions.

AMD A8-5600K @ 4GHz, Radeon 7970 6Gig, 16 Gig Ram, Win 10 , 250 gig SSD, 40" Screen + 22 inch below, Track Ir, TMWH, Saitek combat pedals & a loose nut behind the stick :thumbup:

Posted
Ian,

 

I guess I'll have to spend more time learning about Arduino and DCS-BIOS then. Can you advise what would be the very basic Arduino card for this process? Is MEGA 2560 good enough? I imagine it probably all depends on how many inputs/outputs I need right?

 

DCS-BIOS will work with any Arduino board. See the DCS-BIOS Hardware Buyer's Guide (work in progress). The most inexpensive option with the best price/performance ratio are the chinese Pro Mini clones.

 

The Mega is interesting if you want to have a lot of I/O pins on a single board without doing more advanced stuff like using shift registers or I/O expanders. But for the price of one Mega board, you can get several Pro Minis that will, in total, have more I/O pins.

 

The other thing I like about the Pro Minis is that they are so cheap that you can stock a bunch of them, and if you do accidentally fry one it's only $3 down the drain ($5 if you manage to fry the USB-to-serial converter as well).

Posted

Hi Janis,

 

Although I do agree with Ian and Warhog that you should take a look at DCS BIOS, I have attached my modified joystick defualt.lua file JSGME installation ready.

 

 

 

All you need to do is to install it using JSGME you should be able to map the e.g. Master arm switch for the ARM and TRAIN position. default.lua has been prepared so that if the switch is not in ARM (value_down=0.2) or TRAIN (value_down=0)then it is in SAFE (value_up=0)

See below as example.

 

 

{down = 3001, up = 3001, cockpit_device_id = 7, value_down = 0.2, value_up = 0.1, name = "Master switch ARM", category = "Armament HUD Control Panel"},

{down = 3001, up = 3001, cockpit_device_id = 7, value_down = 0, value_up = 0.1, name = "Master switch ARM", category = "Armament HUD Control Panel"},

In this way you just need to mapped it via the OPTION-CONTROL menu in DCS. Bear in mind that the The CONTROL menu may look al little fuzzy since the structure of the moddet default.lua does not align with some of the other joystick lua files.

 

But it works for me and have been using it for a long time.

 

 

Having said so, I do have do convert for DCS BIOS eventually as it will give me more options especially in relation to potentiometers. I noticed that connecting hardwired potentiometers via Helios causes a lag, probably because the values change constantly dur to voltage fluctuation. To the best of my knowledge this has been taken care of in DCS BIOS.

 

ps. not all panels have been prepared for this in the default.lua

 

Cheers

Hans

HMA joystick default - NEW.rar

1448891664_HMAAHCPcontrolview.thumb.jpg.944f923c0557cfd76670d10ab5582e2a.jpg

Posted

Ian,

Thank you for the info. I will give it a go. See if I can manage my way around. If I'll get stuck there is google and other tools out there to help at the end of the day I can seek for help here as well.

 

HMA,

Thank you too. I've tried your settings but not all of them work. But never mind it gives me an idea. I have noticed though that your lua script is modified in a different way from what I've read earlier. I guess there are various ways of achieving the same results. May I ask you ... how did you know all the values for down = 3001, up = 3001, cockpit_device_id = 7, value_down = 0.2, value_up = 0.1? Is there some sort of reference you use?

 

Kind regards,

Janis

Posted
how did you know all the values for down = 3001, up = 3001, cockpit_device_id = 7, value_down = 0.2, value_up = 0.1?

 

You can determine these values by reading the "clickabledata.lua" file under Eagle Dynamics/DCS World/mods/aircraft/A-10C/Cockpit/Scripts. At first a few educated guesses are required, but after a while you start to recognize patterns.

 

You could also look at A10C.lua in DCS-BIOS.

 

For example, the master arm switch looks like this in clickabledata.lua:

elements["PNT-TMB-AHCP-MARM"]		= {class = {class_type.TUMB,class_type.TUMB}, hint  = _("Master Arm"), device = devices.AHCP, action = {device_commands.Button_1,device_commands.Button_1}, arg = {375,375}, arg_value = {0.1,-0.1}, arg_lim = {{0.0, 0.2},{0.0, 0.2}}}

 

device_commands.Button_X is defined as 3000+X, devices.AHCP is defined as 7 in the A-10C's devices.lua.

 

In DCS-BIOS, it looks like this:

defineTumb("AHCP_MASTER_ARM", 7, 3001, 375, 0.1, {0.0, 0.2}, nil, false, "AHCP", "Master Arm TRAIN - SAFE - ARM")

Device ID 7, command 3001, valid argument values go from 0.0 to 0.2 in steps of 0.1.

Posted
I've tried your settings but not all of them work.

 

Strange. Which ones are not working? All the modded ones are how inputs in my pit are hooked upy.

If you talk about some of the them being light blue and dark, then yes you are correct then it is because of the mismatch between the structure between the modded one and the originals.

 

You may notice that when mapping some of them, when you flip the switch while in the control panel it sometimes goes to a different position than the feld where the joy button name is. But it still works when in pit

 

Cheers

Hans

Posted

HMA,

 

Yes that's what I meant. Also I think (I can't recall now as I demoved these mappings) there was one or two toggles which I could not map at all but to tell you exactly I'll need to use your settings once again.

 

Ian,

You gave me, a absolute beginner, an amazing information to work with. Also I got one of the Arduino boards on my desk and I'm playing with it now. Watching your videos and other videos on youtube. Excited. Confused. Overwhelmed. :)

 

Regards,

Janis

Posted
HMA,

 

Yes that's what I meant. Also I think (I can't recall now as I demoved these mappings) there was one or two toggles which I could not map at all but to tell you exactly I'll need to use your settings once again.

 

Ian,

You gave me, a absolute beginner, an amazing information to work with. Also I got one of the Arduino boards on my desk and I'm playing with it now. Watching your videos and other videos on youtube. Excited. Confused. Overwhelmed. :)

 

Regards,

Janis

 

Janis, I think once you spend just a little time reading up on the basics of using Arduino boards you will be more than excited and overwhelmed. I think you will be extremely satisfied.

 

You see one of the major stumbling blocks in building panels has not been in the fabrication of panels or the wiring of switches Not even the interfacing with DCS. All of that has been available for some time. With some research you can find lots of ways to make your connection to DCS albeit sometimes rather crudely. What DCS-BIOS gives you is that same ability but with a much easy means of implementing it and it takes it one major step further. It gives you the ability to use LED indicators (say: landing gear panel lights) , LCD displays ( say: CMSP panel) rotary encoders and servos or stepper motors for gauges. It has the means of doing EVERYTHING that is in the cockpit. But I only want a couple of switches you say... That's how it always starts.:music_whistling:

 

But that's just my very biased opinion.:)

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Posted

Warhog,

You are absolutely right. I managed to get CMSP lcd on my hardware LCD which I wired up last night and I got my servos running. Sky is the limit really now. Hopefully next month I'll have all the woodwork ready and fixed together then it'll be panel building time.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...