Microflow studio
Switch
Similar to a Button
, a switch is a simple input device that can be either open or closed.
In comparison, a switch will hold its state until it is changed, while a button will only be active while it is being pressed.
Types of switches
Switches come in many shapes and sizes. Below are a few examples and how to wire them up.
Wiring
The wiring examples are for illustrative purposes, it might not work with your particular switch.
Is my button active table
Switch Type | Switch State | Input Pin State |
---|---|---|
Normally Open (NO) | On | HIGH (1) |
Normally Open (NO) | Off | LOW (0) |
Normally Closed (NC) | On | LOW (0) |
Normally Closed (NC) | Off | HIGH (1) |
2 pin on-off switch
A 2 pin switch requires a resistor to work properly.
3 pin on-off switch
A 3 pin switch is similar to a 2 pin switch, it does not require a resistor but it has an additional pin that is connected to the input pin.
The input pin is usually connected to the middle pin, while the other two pins are connected to the ground and power.