In this chapter, we had an introduction to the use of digital inputs by working with two different examples, each one showing different devices that can be used as digital sensors.
We saw what a momentary push button is and its particularities and also learned the right way to connect one to Arduino to be used as a digital input.
We also saw that there are lots of other devices that can be used as digital sensors and, in a second example, we used an optocoupler as an optical switch to build a coin detector.
From the point of view of programming, we met the
if control structure in its two versions, simple and with a negative
else branch, and learned that it can be the basis of any logical decision in our code.
In the next chapter, we are going ...