Switches

to input pulses for a control system to count - the number of laps completed by a runner for example

to act as a sensor to trigger an alarm when a door is opened.

Switches are manufactured in a number of different forms.
Here are some:

Momentary acting (push switch)

For example, the switch on a doorbell, which causes something to happen only while it is being pressed.

Toggle switch

For example, a light switch, which switches on (and stays on) the first time it is pressed, and switches off the next time.

Tilt switch

This switches on when the body of the switch is tilted to a certain angle, or beyond.

Rotary switch

For example, the selector switch on a hi-fi system, which you use to switch between the tape-deck, the CD deck and the radio tuner. To operate it, you turn a knob attached to the spindle of the switch.

Key switch

For example, the switch used in a car ignition circuit, which operates only when the correct key is inserted.

Magnetic switch

This switches on when a magnet is placed next to the switch, and off when the magnet is moved away again.