A switch has 2 states. Up:=1 , down:=0, how to connect when it goes from 1 to 0?

0 votes
asked Jun 4, 2017 by rvd2 (12 points)
edited Jun 4, 2017 by rvd2
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 Jun 15, 2017 by jroberts (16,905 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.

Welcome to X-Plane Q&A, where you can ask support questions and get answers from members of the community.

This site is for X-Plane support questions only. Please search for existing answers before posting your question. Off-topic questions will be locked.

If you’re new, you’ll need to register before asking your first question.

If your question is answered, click on the check mark to select the best response.