Arduino - Button
Button And Switch
This article will give an example how to use Arduino board with a switch. The Arduino board reads the digital status of the switch as an input to execute an your functions.
There are two types of switching circuits.
There are two types of switching circuits.
- pull-up (Normally the status is '1', If you press the button status is set to '0')
- pull-down (Normally the status is '0', If you press the button status is set to '1')
Switching circuit, pull-down
In this article, we will select a pull-up circuit (Normally the status is '1', If you press the button status is set to '0')
Example.
pull-up circuit switch
Example Program
Arduino has special functions for internal pull-up circuits. So we can use only switch. (Must be declared as INPUT_PULLUP)
Internal pull-up circuit switch
Example Program
Comments
Post a Comment