Button Pad Hookup Guide
Introduction
This tutorial introduces matrix-scanning tecnniques, using the SparkFun 4x4 Button Pad to build an illuminated keypad.
More importantly, we'll introduce the concepts underlying the design and implementation of matrix scanning, so the reader can adapt and extend the techniques for their own projects.
Covered in this Tutorial
This tutorial is structured as a series of progressive exercises. First, we'll explore the underlying concepts and underpinnings of the design. Then we'll apply what we've learned, assembling the PCB, and working through several applications, starting simply, then adding features and complexity.
- We'll start by assembling the the keypad.
- Next, we'll introduce matrix scanning by getting a single color of LED to light.
- From there, we'll add the buttons as an input device.
- Finally, we'll enable to other colors of the LEDs in the matrix.
Along the way, we'll explore some of the design decisions that contribute to the keypad, and look at some of the coding techniques that are used to control the hardware.
Suggested Reading
- We're going to be doing some low-level programming in this tutorial. This assumes that you're familiar with Binary numbers and converting them to and from hexadecimal and decimal representations.
- In particular, we're going to be using bitwise operators to perform the matrix scan.
- You'll need to be comfortable with Through-hole soldering. Assembling the button pad involves some more sophisticated soldering techniques than most of our other soldering projects.
- The matrix scanning will take advantage of internal Pull-up Resistors
- The matrix scanning also uses diodes to isolate the switches from each other.