CHAPTER 10

image

Debouncing

The idea of attaching a push button to a GPIO input is deceptively simple. Use a push button and a couple of connections and some simple software to read a 1 or a 0, right? After all, it’s digital input and just 1s and 0s. It all seems so elementary, yet things are more complicated than that.

What actually happens goes against intuition because we think and operate more slowly than a digital circuit. The physical action of pushing a button might require a half-second or so, so we tend to think in those terms. On the other hand, a digital circuit can react to a million of events in the same time frame.

This chapter explores ...

Get Exploring the Raspberry Pi 2 with C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.