O'Reilly logo

Arduino Essentials by Francis Perea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting a button as a digital input

The simplest circuit that we can prepare to be used as a digital input is that consisting of a switch connected to a digital input of the Arduino board.

A typical momentary push button usually has two states, open or closed, and acts like a switch that, when not pressed, keeps the circuit open, preventing the connection between the two parts of the circuit it connects, and when pressed, makes these two parts connected.

Keeping in mind that an Arduino digital input can sense values of 0V and 5V, we have to prepare our circuitry in such a way that it provides a 0V signal to the Arduino digital input when we want to consider it LOW and a 5V signal when we want to consider it HIGH.

To be precise, the Arduino microcontroller ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required