This site is being deprecated.

Please see the official X‑Plane Support page for help.

0 votes
asked by (12 points)
edited by
I have a panel (HID device) with a switch that sends 1 when the switch is up and goes to 0 when the switch is down.

How can i connect the state of the switch to XPLANE via using the Buttons: pro interface?

generator_1_on when the switch := 1

generator_1_off when the switch := 0

Is there a kind of lua style to configure it ?

If in the HID interface the name of the switch is 2.

generator_1_on := (switch_id_state(2)==1)

generator_1_off := (switch_id_state(2)==0)

 

Thank you for your help.

1 Answer

0 votes
answered by (19.3k points)
I assume you're using X-Plane 10. X-Plane may read each state of the switch as "held" inputs--if you flip the switch watch if a box has a green check mark that never goes away in the Buttons: Adv screen. You'll need to set the two states to on and off commands. There may not be both for every option. Ex: Igniters/Igniter #1 has both an on & off option, so it could be set to the switch state up and down respectively. Assigning GPS/G-430 Nav-1 chapter dn on the other hand would be like constantly holding the chapter button on the device.
...