So you just use the central pin and one of the outside pins as if it were any other on-off switch or pushbutton. The central pin is the common, and when slid to one side it connects that central pin to the corresponding outside pin. You have two positions, but you really only care about one of them, since if it's not in that position it must be in the other. These switches are actually a lot more simple than you would think.
To use it for you Arduino, check for a normal simple switch example, but these are two in one, one for each position. 5V -> pin 1, pin 2 -> resistor of 220 ohm -> LED -> GNDĪnd change pin 1 and pin 2 until you found which pins connect for which positions. Instead of a multimeter you also can 'hardwire' it to e.g. Than switch the position, and do it again. If there is resistance, try other pins with the probes, until you know which are connected. Check if the resistance is 0, in that case you know those two pins will be connected when position 1 is selected. Set it to continuity mode, or if you don't have that mode, to resistance mode, and put the red/black probes to two random pins. To find out which is pin 1, pin 2 and pin 3, use a multimeter. However, you always can verify this, in the following way:
This means it will be connected to the outside pins depending on where the switch is moved towards. Since it has two possible positions, and three pins, you have a connection between pin 1 and 2 when position 1 is selected, and between pin 1 and 3 when position 2 is selected.Īs BSF comment below, the middle pin is common.