Type Here to Get Search Results !

How To Read Digital Inputs In Arduino Uno R3 Board?

Now is the motivation here? Reading digital inputs will help us to interact our arduino with the external environment in real-time. In our case we are going to use very simple digital sensors that are called "pushbuttons". Now just to understand the simple operation of a pushbutton switch. In normal situation, meaning nothing is pushing the button, it will be open, cutting the circuit.


When being pressed it close the circuit so in that case we can detect such scenario using a digital input pin and then trigger something. To read the status of a button, we first need to define a specific digital pin as an input in the setup() function.

Next, to discover whether the button is pressed we will use digitalread(pin) function, where "pin" is the digital pin number to read. However, one thing that is important to add to this circuit is something that is called "pull up or pull down" resistors. Now let’s understand why they are needed and how to use them ? Please watch this video for practical demonstration of this article.



Post a Comment

0 Comments