Button Switch
Mechanical button switch with 4 pins
Overview
Section titled “Overview”The Button Switch is a mechanical momentary switch with 4 pins:
L1, L2, R1, R2.
It is commonly used in embedded systems for user input, such as triggering GPIO interrupts or toggling logic levels.
Pin Behavior
Section titled “Pin Behavior”- L1 is always internally connected to R1
- L2 is always internally connected to R2
- The two pairs (L1–R1 and L2–R2) are electrically isolated from each other by default
Pressed State
Section titled “Pressed State”When the button is pressed, the switch closes the circuit between the two pairs, effectively connecting all four pins together.
This allows current to flow between both sides of the switch and is typically used to pull a GPIO pin high or low when pressed.
Released State
Section titled “Released State”When the button is released, the connection between the two pairs is opened again, returning the switch to its default isolated state.
Example
Section titled “Example”The following example showing a button switch used to interrupt on click.