Summary
We have learnt a bit more about digital inputs. Digital inputs can be used directly, as we just did, or also indirectly. I'm using this term because indeed, we can use other peripherals for encoding data before sending them to digital inputs. I used some distance sensors that worked like that, using digital inputs and not analog inputs. They encoded distance and popped it out using the I2C protocol. Some specific operations were required to extract and use the distance. In this way, we are making an indirect use of digital inputs.
Another nice way to sense the world is the use of analog inputs. Indeed, this opens a new world of continuous values. Let's move on.