Chapter 5. Working with Digital Inputs, Polling and Interrupts
In this chapter, we will use digital inputs to make it possible for users to interact with the board while we process the HTTP requests. We will:
- Understand the difference between pull-up and pull-down resistors to connect pushbuttons
- Wire digital input pins with pushbuttons
- Use polling to check the pushbutton status with the
mraa
andwiring-x86
libraries - Combine polling to read digital inputs while running a RESTful API
- Write code that maintains consistency when we provide shared features with electronic components and APIs
- Use interrupts and the
mraa
library to detect pressed pushbuttons - Understand the differences, advantages, and trade-offs between polling and interrupts to detect changes in digital inputs