how to connect push button to microcontroller?
Basic interfacing circuit of a push button switch is given below. Here, the switch is directly connected to the microcontroller through a resistor to limit the sourcing current. Sourcing current is the current which passes to the microcontroller when the switch is closed (ON state).