Raspberry Pi Micro Switch kw11 3z
Your lever switch is called a single-pole-double-throw switch, SPDT. As it sits, you will measure very little resistance between COM and NC. Between COM and NO you should measure very high resistance (like infinite, or off-scale resistance). And between NO and NC, you should measure very high resistance.







simulate this circuit &ndash; Schematic created using CircuitLab
For the schematic shown, your GPIO will read "low" (logic 0) when the lever of SW2 is not activated, and will go "high" (logic 1) when the lever is pushed. Be aware that any switch when it changes state, will bounce around between the two logic states, for an undetermined number of bounces, before settling to its next state. This bouncing may take many milliseconds before settling. So if you wish to count button-presses, you may count very many bounces for a single press.
The resistor R1 is required for reliability. It is called here a "pull-up" resistor, because it applies a 3.3v logic level to the GPIO pin when the button is pushed. Its value is not critical, but as shown, 33 microamps is pulled from the 3.3v supply until the button is pushed. So you don't want to make R1 too small in value.
You have wired it in an alternate way, with GPIO going to "NO" terminal, as in SW3. The pull-up resistor should be wired to this terminal. Now, a push will yield logic low, while un-pushed will yield a logic high. This works too, but use that pull-up resistor so that un-pushed, GPIO sees a "high". This may be a safer circuit. If you were to re-program a GPIO pin to be an output rather than an input, your output would see a 10K resistor until the button was pressed. Once the lever is pressed, the GPIO would see a short to ground, and could harm the driver inside the PI's CPU. GPIO's generally power-up as "inputs" rather than output. Ensure that your GPIO is set as "input" when reading switch state.