First, remember that not every LED located on your panels needs to be assigned as a SimVim parameter and wired to the controller! This only needs to be done if the LED is used to indicate system, not a switch state (system on, off, failures).
Note that even if you see that your virtual plane model has a specific dataref for each LED, you should not use all of them. The point is that the plane model developer must use the datarefs in the X-Plane for each indicator and switch to associate the corresponding graphic / animation elements with them for visual presentation on the virtual panel.
There are many LEDs in a real cockpit that only indicate the ON or OFF switch position, especially when it is a push-button switch (korry-type), the mechanical positions of which are not easy to distinguish.
In this case, the LED can be directly controlled by this switch, instead of using na extra digital output, extra wires, and receiving data from X-Plane.
1. DPST or DPDT switch / push button switch
Using toggle switches (including bush button self-locking switches) with more than one “pole” terminal (DPST or DPDT) allows you to use one contact group for the input signal control, and another group for LEDs on/off control:
But if you have a single-pole (SPST, SPDT) switch, you can still use a LED to indicate its current position. All possible options are described below.
2. SPST switch
For this switch type (ON-OFF) you can easily implement the “ON” status indication. To do this, you need to connect the LED’s cathode to the same terminal that is used as the input signal, and the anode must be connected to the +5 bus with the appropriate resistor in series. The value of the resistor should be chosen based on the LED brightness that you want to get, but preferably not less than 500 Ohm. From my experience, even if you use a resistor of 2-3 kOhm the LED brightness can be quite enough to indicate that the switch is ON.
As all inputs are configured in SimVimCockpit firmware as default high-level state with pull-up resistors, connecting a LED this way will not affect the digital inputs in any way. Throwing the switch will short the circuit to the ground, activating both the input and the LED connected to it.
3. SPDT ON-ON switch
It’s more common type of switch switch with two fixed states as the SPST with one pole, but has two throw terminals (ON-ON). In most cases, such switches are used as simple SPST (ON-OFF) switches, described above, when only one of the output terminals is used. The other output terminal remains free.
For this switch type you can implement the “OFF” status indication by using the second signal line. You need to connect the LED’s cathode to the terminal that is NOT used as the input signal, and the anode to the +5 bus with the appropriate resistor in series.
The difference from the SPST switch is that you can use any resistor value that you need for your LED brightness, and you can even use any VLED voltage to power the LED, because in this case it doesn’t interfere with the signal line.
At the same time, you can still use the signal side for the ON state indication LED as described for the SPST switch above. Or, you can use both position LEDs as shown in the picture below. Note that the two LEDs used here are powered from +5V and have a single resistor (only one LED can be powered at the same time). As an option you can use two power lines and two resistors.
4. SPDT ON-OFF-ON switch (3-position)
A 3-position (ON-OFF-ON) toggle switch has the same 3 terminals as (ON-ON) switch described above, but with fixed position in the center (OFF). It acts as 2-way toggle switch, connecting the input terminal (pole) to one of the two output terminals or disconnecting both.
For this switch type you can make the indication for both “ON1” and “ON2” position using the signal lines. You need to connect the LED’s cathode to the same terminal that is used as the input signal, and the anode must be connected to the +5 bus with the appropriate resistor in series. Again, the resistor value is chosen based on the LED brightness required, and preferably not less than 1 kOhm.
5. Rotary Switch with a single group of position terminals
A multi-position rotary switch (here is an example with 5 positions) that has only one pole and only one group of 5 throws is used like 5 separate SPST switches that can not be in the ON state at the same time.
Connect the LED’s cathode to the same terminals that is used as the input signals, and all the LEDs anode must be connected to the +5 bus with one resistor in series. The value of the resistor should be chosen based on needed LED brightness as described above for SPST switch.