Switch
A latching toggle or slide switch that maintains its on/off state — unlike a momentary button.
Overview
A switch is a simple mechanical input that stays in its current position until manually toggled. Unlike a push button (which is momentary), a switch latches — flip it on, and it stays on. This makes it ideal for mode selection, enable/disable controls, and power toggles.
ArduinoStudio treats a switch as a digital input that fires open and close events when toggled.
Specifications
| Parameter | Value |
|---|---|
| Type | Toggle / Slide / Rocker |
| Rating | 0.3A / 30VDC (typical) |
| Positions | 2 (ON/OFF) |
| Logic | Uses internal pullup — reads HIGH when open, LOW when closed |
Wiring Guide
| Switch Terminal | Arduino Pin |
|---|---|
| Terminal 1 | Any digital pin |
| Terminal 2 | GND |
No external resistor is needed. ArduinoStudio enables the Arduino's internal pullup resistor automatically, so the pin reads HIGH when the switch is open and LOW when closed.
Usage in ArduinoStudio
Drag the Switch component onto the canvas and assign a digital pin. The switch emits two events:
- close — fires when the switch is flipped to the ON position
- open — fires when the switch is flipped to the OFF position
Use these events to trigger conditional logic — for example, enable a motor only when the switch is ON, or change LED modes based on switch state.