© Neil Cameron 2019
Neil CameronArduino Appliedhttps://doi.org/10.1007/978-1-4842-3960-5_2

2. Switches

Neil Cameron1 
(1)
Edinburgh, UK
 

Switches are used to turn devices on or off, such as a room light or an electrical appliance, and when sending a signal, such as pressing a particular key on a keyboard. Switches can also be used to control devices; a device is on when the switch is initially pressed or while the switch is pressed. The metal contacts of switches can bounce when the switch is pressed, which could repeatedly turn a device on and off again. Switch bouncing can be controlled using software or by hardware, which is called debouncing a switch.

Tactile Switch

A switch can be connected to an Arduino pin to turn an LED on or off. When the switch ...

Get Arduino Applied: Comprehensive Projects for Everyday Electronics now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.