Jump to content

DCSBIOS and KA50 - coding issues (Switch+switch cover and other)


Recommended Posts

Posted

Hi all.

Still stucked in my home cockpit building since ....... you better you don't know about, I'm now starting seeing the light at the end of the tunnel.

Hardware is 75% done (3 or 4 non functional panels missing, and the main structure), electronics (PCBs at 99% and full working - untill now), and time is come to start playing with coding.

Not really a big issue, Ian made it really easy. Nevertheless, I'm getting some puzzlements.

The main one: the "switch cover affair"......

I've read several post here in DCS concerning the affair, but it seems all of them are all "joystick user oriented" only; it means I'm still fighting with finding a solution.

I learned that Ka50 LUA philosophy about the command mapping is very different from the...standard one (A10 and F18); of course, in the worst meaning....

As many people, I tried the easiest cheat: programming the same arduino's pin to drive both commands set (cover + switch). Obviously, it doesn't work....too much easy, uh....?

Maybe the next (easy?) solution could be the alteration of LUA files by merging the 2 individual code lines (cover and switch) in one, so my questions become: wich LUA files are involved? And the most big question: is there anybody out there who can simply exemplify how to merge the 2 lines? Moreover as Ka50 LUA philosophy striles a discordant note.......

Once understood the mechanism, everyone (not only me) interesting in such stuff would be very grateful.

A second issue is related to using a rotary switch.

Exemplifying: the Datakling mode selector is a 4 position rotary switch, and the related DCSBIOS code drives 4 pins; someway, it makes sense: all the 4 positions have a meaning.

But considering the overhead's navlight switch (but the same for many other multipos switches): is a 4 way switch (OFF/10/30/100%). Find a 4 way level switch, well....so I opted for a rotary switch. The DCSBIOS code drives 5 pins.... My puzzling becomes: Why 5 pins to drive 4 positions??? And: can only 3 pins drive this switch? after all: pin 1>10%, pin 2>30% pin 3>100%, no pin> OFF

 

My coding tale is just begun, so it is very likely I'll get stucked somewhere, altough I hope not, this case I'm afraid I'll bother you again.....

By now, thanks in advance to everyone will support me .

Cheers

Jocman

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Posted

First of all, thanks for your support.

About the FlightPanels fork, I went to this alternative last week.

Honestly, since I've been starting coding about 3 weeks ago, I coded a couple of...."easy" panels, meaning just push button and leds, with or without display.

I'm referring to PVI-800 and UV-26, and a couple of other panels with no switch covers.

Since it was a little bit long, i'm quite reluctant to leave the "old way" considering the follows:

- the release of DCSBIOS HUB is, to me, a great solution in managing the system: connecting to sim, and managing the control reference... piece of cake

- Reading the docs about the fork, I'm getting a little bit confusing...I'm not understandig if by adopting the fork, i can keep using the HUB to connect the boards to the sim, or i've to "downgrade" to the previous management system (i.e. as I reed, the fork suggest to use the old chrome control reference, instead of the new one in HUB: is there any reason to not use the new one? the control reference isn't the same?ok there's the "T" suffix now, but the rest of?)

- By examining the new fork libraries (at least about the switches section) I've seen the commands now have different names (i.e Switch2Pos is now Switch2PosT) and evend the code side differs from the Ian's original one. This means, by adopting the fork, I'll have to recode everything to match the new library.

 

Well......I could even switch to the fork, but it will worth? I'm not again it, but I just wish to understand....

In my spare time, I'm trying to see if someway I can create a code similar the fork's for the switch cover to merge into the "original" Ian's library. I'm not so into C++, but who knows....

 

Beside this, about the rotary switches and their pins?

Thanks

Jocman

 

 

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Posted

I have the Latest Flightpanels arduino library, and there's no T suffix I can see.
All my hub code works OK in FP.
There are a few differences, but that is because of the one thing Hub is missing - maintenance.
Hub is not currently updated, so new aircraft and some modifications can't be used with Hub.
Flightpanels is actively updated, so even though it may have a lower "version number" than Hub, it is actually more recently updated.

For example:
I don't think Hub can do this:

DcsBios::SwitchWithCover2Pos pltLaunchbarAbort("PLT_LAUNCHBAR_ABORT", "PLT_LAUNCHBAR_ABORT_COVER", 6);

 

Posted (edited)

About the T suffix

I confirm, the FlightPanels library (at least, the one I got) have the T as suffix (reading directly the library).

I got it from GitHub, or there's another website more updated where to get it?

Currently, I wrote the code by manually building the line and getting the code from the HUB aircraft reference, but is there any aircraft reference adapted to FlightPanels?

Nevertheless, by giving the command like Switch2PosT I get an error message; giving it without T, it does work....

On 2/7/2022 at 7:30 PM, No1sonuk said:

I don't think Hub can do this:

DcsBios::SwitchWithCover2Pos pltLaunchbarAbort("PLT_LAUNCHBAR_ABORT", "PLT_LAUNCHBAR_ABORT_COVER", 6);

 

Nope, you're right, it doesn't.

But i made a try. Compiled the arduino file with the FlightPanels library and launched the HUB. It works.

BTW, so as HUB is not updated (at least, until now) are you suggesting me to use the "old" command line DCSBIOS SOCAT? If so, wich release?

And, when you say "some modifications can't be used with Hub.", what are you referring to?

I know I'm almost....poor in new developments, but I'm spending all the freetime I can in trying to finish the building of my cockpit, and honestly I'm not so updated....

 

Thanks

Jocman

Edited by Jocman

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Posted

 

When I said some mods can't be used with Hub, I meant that modules, etc. added after Hub was "stalled" couldn't be compiled using the Hub version of DCS-BIOS as the code for them wouldn't be there.

However, it looks like you found an interesting combination...

The arduino library is used to code your text into something the arduino's processor can read.

It appears that once you've done that (by compiling your code using the Flightpanels library), the easier to use Hub interface can then be used to connect the arduino to DCS.

Nice find.

  • 2 weeks later...
Posted

Going on with coding, time to pass to LWR.

Easy one (8 LEDs and 1 BTN), nevertheless......

As the hardware test shows all the LEDs working (just a simple cycle in arduino), once launched the sim there's no way to see the BTN working..... You can push it whenever you want....nothing....

I double checked (but even triple quadruple, etc etc) everything about the BTN (DCSBIOS code, hardware wiring, etc etc) but nothing to do.

By using a test sketch (the standard arduino example sketches) the BTN (so as the hardware wiring) works fine......

Any idea?

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

  • Recently Browsing   0 members

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