This tutorial is for beginners in the field of micro-controller.The purpose of this tutorial is use of push button switch with the micro-controller. It will be useful whenever a decision is to be made according to the press of a switch.
Input/output devices are very critical components of an embedded system. The first input device we will study is the switch. It allows the human to input binary information into the microcontroller. Typically we define the Two state, logic true, when the switch is pressed. logic false, when the switch in not pressed. A single pole single throw (SPST) switch has two connections. The switches are shown as open circuit in Figure 1.which is a normally open switch (NO), the resistance between the connections is infinite (over 1000 MΩ) if the switch is not pressed and zero (under 0.1 Ω) if the switch is pressed.
Switch interface circuit |