Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to obtain codes for example DED ENTR (F16) = 3016? #41

Closed
iancoetzer opened this issue Aug 23, 2022 · 5 comments
Closed

How to obtain codes for example DED ENTR (F16) = 3016? #41

iancoetzer opened this issue Aug 23, 2022 · 5 comments

Comments

@iancoetzer
Copy link

Hi

Where do you obtain the codes?
For example the DED ENTR (F16) you have as code 3016.

When I look in the clickabledata.lua of the F16, the DED ENTR (F16) button code is 178?

Thank you.

I want to add additional buttons to your Java app to toggle switches such as auto pilot / main battery on/off , landing gear up down etc.

@iancoetzer
Copy link
Author

Aha, found this that lists most of the device IDs and also the codes ...

https://github.com/dcs-bios/module-f-16c-50/blob/master/F-16C_50.lua

Still curious where this was obtained...

I want to use your code to toggle switches such as the battery between the three states, 0=0ff, 1=batt, 2=main generator...

@iancoetzer
Copy link
Author

Another question, how to turn a knob via script?

I have managed to set the IFF to normal like this:
//IFF, set to Normal
commandArray.put(new JSONObject().put("device", "35").put("code", "3002").put("delay", "0").put("activate", "0.3")); //-1, 0, 1

But how would I set the HMCS turnable knob to say 50% brightness via similar JSONObject?

    //HMCS Knob, how to turn? This does  not work. 

commandArray.put(new JSONObject().put("device", "17").put("code", "3022").put("delay", "0").put("activate", "50")); //-1, 0, 1

Thank you

@BlueFinBima
Copy link

BlueFinBima commented Aug 23, 2022 via email

@aronCiucu
Copy link
Owner

Hi, the codes are from that DCS BIOS repo as you found out. For dials, I am not too sure but it should be similar to how the IFF switch is. By the way, if you are trying to make a startup sequence, best way is to change the built in DCS autostart lua file. I made my own version of that, the way I wanted it.

@iancoetzer
Copy link
Author

iancoetzer commented Aug 23, 2022

Hi, thank you for all the replies. I have just achieved the desired result with 'DCSTheWay'.

`
public static void coldStart(){

    JSONArray commandArray = new JSONArray();

    //Battery, set to Main Generator (-1=OFF, 0=BATT, 1=MAIN PWR)
    commandArray.put(new JSONObject().put("device", "3").put("code", "3001").put("delay", "0").put("activate", "1"));  

    //IFF, set to Normal (0=OFF, 0.1=STBY, 0.2=LOW, 0.3=NORM)
    commandArray.put(new JSONObject().put("device", "35").put("code", "3002").put("delay", "0").put("activate", "0.3"));  //0.1, 0.2, 0.3=NORM

    //HMCS Knob, turned to 50% brightness (0.5)
    commandArray.put(new JSONObject().put("device", "30").put("code", "3001").put("delay", "0").put("activate", "0.5")); 

    PortSender.send(commandArray.toString());
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants