Using three position switches - MobiFlight/MobiFlight-Connector GitHub Wiki
Three position switches are common in flight simulation. You can see them used in an aircraft for landing lights switches, panel lights brightness switches, APU Start switches and many other places. There are several different types of three position switches that can be used in Mobiflight.
- ON-OFF-ON SPDT with three terminals. This is by far, the most common and simple type to use. The two end terminals are connected to the middle common terminal depending on whether the switch is in up or down position, with nothing connected while the switch is in the middle position.
This picture shows how it is typically wired to an Arduino board.
The three position switch is configured in Mobiflight input as two separate button config, where the two extreme positions (up and down) are the On Press events. The middle position is modeled as the On Release event of both button configs.
- ON-OFF-ON DPDT with six terminal. Very similar to the above but with double the terminals. It works like two SPDT switches actuated by the same lever. The wiring is done in the same way as the SPDT 3-position switch above. The other half of the six terminals go unused. In Mobiflight you don't really need the double pole feature, as the wiring is normally done to only two Arduino pins.
- ON-ON-ON DPDT with six terminals. Commonly used in electric guitar pickups wiring. This type of switch is less used type in Mobiflight, but it can be used nonetheless.
The recommended configuration for this switch to operate as ON-ON-ON is to connect terminals 3 and 5 together, as shown in the diagram below. GND is to be connected in terminal 2, while the three ON positions will be at terminals 6, 4 and 1 that will go to Arduino pins respectively.
In Mobiflight, you will configure one input config (On Press) for each of the three positions.
It is also possible to use the ON-ON-ON switch as an ON-OFF-ON switch simply by ignoring the middle position and choose to not connect terminal 4 to an Arduino pin. The input configuration would be the same as the first type, using the On Release config of both the Up and Down input configs to model the middle position, thus saving one Arduino pin.