Most of the systems in an aircraft cockpit are controlled with toggle switches, multi-position switches and momentary push-buttons. For parameter value increment/decrement two coupled momentary push-buttons (- and +) can be used in your cockpit. It can be buttons for map zooming, clock setting, trim adjustment, as well as for any other incremental inputs instead of using encoders.
Also, the rotary encoder is a commonly used input device for changing numerical data step-by-step. With SimVimCockpit you can configure any two input pins either as encoder inputs or as a pair of increment/decrement buttons.
Any switch, button, or encoder can be connected to the master controller board directly, without using extension boards. But this is very inefficient, and you can use this option for initial tests purpose, or if you have a very simple control panel with a few switches, or you just need to add additional switches to your system.
SimVimCockpit allows you extend each single input to x16 using a cheap extension boards (multiplexers 1x16). All multiplexers used for inputs are connected to 4 common address lines! So, you need only 4 wires to connect all input multiplexers together and, of course you need to use 2 power lines - +5V and Ground for each board.
The SIG (or Z) output of every input multiplexer is connected directly to the pin assigned in the configurator for this input extension.
The "EN" signal of each input extension board should be always logical "0" (set to GND). Usualy the multiplexer breakout board has a pull-down resistor on this 'EN" pin, so it can be already set to logical "0" but you need to be sure it is, so just connect it to GND.
1. To work with SimVimCockpit correctly, the throw terminals of every toggle switch or push-button should be connected to one input directly, without using any pull-up/pull-down resistors. Another, "pole" terminal is connected to the common GND bus.
2. To work with SimVimCockpit all encoders (or pair of push-buttons) should be connected to Arduino pins or multiplexer pins directly, without using any pull-up/pull-down resistors. Each encoder always occupies two adjacent inputs, and the common "C" terminal of each encoder is connected to the common GND bus.
NOTE: you need to know the positioning of the common ("C") terminal in each encoder, because it can be either in the middle or not.
Read more technical details about encoder types on this page: Tech Guides - Rotary Encoders
If you use an encoder that has built-in switch you can use it as any other external switch (assigning a button parameter to it) or as a "mode" button for encoder mode switching, to control more than one parameter with a single encoder.
3. Toggle 3-position switch uses two inputs (n, n+1) with common (middle) terminal connected to GND and normally when the switch handle is in "UP or DN" position one of two input pins is closed to GND. In middle position both inputs are open.
4. Multi-position (rotary) switch uses as many inputs as many positions it has, with common terminal connected to GND and normally when the switch rorates one input pins is closed to GND.
NOTE: Before fixing some switch (simple or 3-position) on your panel please read these "connection rules" for SimVim. <<<. For simple On/Off toggle switch used in most common panels there is one rule - when you short the controller pin to the GND - it is always the "ON" state. All you need is to test the toggle switch before and place it the way that it is in OFF state when not shorted to the GND.
You can group a set of switches into one module/panel using multiplexer extension boards. Place several modules in different parts of your cockpit and connect them to the main board using only one pin for each multiplexer and the common 4 address wires that are laid across the cockpit to each multiplexer:
If you have noticed that some of your assigned switches or encoders are not stable, for example they send excessive On/Off signals when you activate them, do not cosider this a switch bouncing problem, as SimVim firmware code has good debouncing protection.
If you see that switches in your virtual plane cockpit are occasionally "flicking" when the real swithes are in OFF state, that means you have either missed common GND or "noisy" electric environment in combination with rather long wires.
The multiplexer Z output wired to the master board input has high-impedance "open" state and the wire can catch such EM interference that depends on the electic noise level in power source lines and other surrounding wires. Although all assigned controller board inputs already have internal pull-up resistors connected, their 50k nominal could be not effective enough for long wires.
Although we recommend to use the 16-channel multiplexers for inputs, even if you don't use all 16 channels, you can also use the 8-channel 74HC4051 multiplexer when you don't need many switches in one particular place.
There is no difference in code performance because the firmware function always counts it as 16-channel MUX.
Note: if you use the 8-bit multiplexer board you should not connect the "EN" input to the "GND". Instead you need to use the first 3 bus address lines for S0..S2 and connect the 4-th address line to the "EN" input of this multiplexer board.
Assigning the toggle switches, buttons and encoders in the configuration is easy and intuitive process - simply find needed parameter in the the table and select input for it - either direct pin or multiplexer output (multiplexer should be assigned before this!).
You can select any pins for one switch position in any order, but more likely you would choose one sequential set of inputs, when input pins are positioned one-by-one.
In SimVim Configurator most of the commonly used rotary switches are pre-defined as "macros" to ease configuration process. When you select a parameter from the list which is pre-defined as multiposition switch and select the first input number the configurator assigns the next several sequential inputs according to the number of positions. Pre-defined rotary switches stricly use only sequential inputs.