Mechanical switches are commonly used to feed any parameters to the digital systems.
The switches can be interfaced to a microcontroller using digital inputs.
The software program for switch interfacing can be implemented using one of the following two methods