Chapter 3. Working with Buttons

In this chapter, we will cover the following recipes:

  • Connecting a button
  • Button with no resistor
  • The toggle. switch
  • Button to serial
  • Button debouncing
  • 1,000 buttons, 1 pin
  • Button multiplexing

Introduction

Buttons are the basis of human interaction with the Arduino. We press a button, and something happens. They are simple components, as they only have two states: opened or closed. When a button is closed, current can pass though it. When it's opened, no current can pass. Some buttons are closed when we push them, some when they are released.

In this chapter, we will explore various button configurations and see how to tackle common problems with these. Let's jump in!

Get Arduino Development Cookbook 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.