# Adafruit LED Backpacks

## Overview

What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88 "Link: https://www.adafruit.com/category/37\_88") or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are 'multiplexed' - so to control 64 LEDs you need 16 pins. That's a lot of pins, and there are [driver chips like the MAX7219](https://www.adafruit.com/products/453 "Link: https://www.adafruit.com/products/453") that can control a matrix for you but there's a lot of wiring to set up and they take up a ton of space. Here at Adafruit we feel your pain! After all, wouldn't it be awesome if you could control a matrix without tons of wiring? That's where these adorable LED matrix backpacks come in.   
  
We have them in quite a few flavors!

- [Adorable Mini 8x8](https://www.adafruit.com/search?q=mini+8x8+backpack "Link: https://www.adafruit.com/search?q=mini+8x8+backpack")
- [Classic 1.2" 8x8 (round and square dots)](https://www.adafruit.com/search?q=1.2%22+8x8+backpack "Link: https://www.adafruit.com/search?q=1.2%22+8x8+backpack")
- [Mini 1.2" 16x8 (round and square dots)](https://www.adafruit.com/search?q=1.2%22+16x8+backpack "Link: https://www.adafruit.com/search?q=1.2%22+16x8+backpack")
- [4-digit 0.56" 7-segment](https://www.adafruit.com/search?q=7-segment+backpack+0.56 "Link: https://www.adafruit.com/search?q=7-segment+backpack+0.56")
- [4-digit 1.2" 7-segment](https://www.adafruit.com/search?q=4-digit+7-segment+1.2%22 "Link: https://www.adafruit.com/search?q=4-digit+7-segment+1.2%22")
- [4-digit 0.54" 14-segment Alphanumeric](https://www.adafruit.com/search?q=alphanumeric+backpack "Link: https://www.adafruit.com/search?q=alphanumeric+backpack")
- [Bi-color 8x8](https://www.adafruit.com/products/902 "Link: https://www.adafruit.com/products/902")
- [Bi-color Bargraph](https://www.adafruit.com/products/1721 "Link: https://www.adafruit.com/products/1721")

![](https://cdn-learn.adafruit.com/assets/assets/000/000/163/medium800/led_matrix_ID872_LRG.jpg?1396760889)

![](https://cdn-learn.adafruit.com/assets/assets/000/000/134/medium800/led_matrix_red7segbackpack.jpg?1396760704)

![](https://cdn-learn.adafruit.com/assets/assets/000/017/227/medium800/led_matrix_1912-08.jpg?1402080444)

The matrices use a driver chip that does all the heavy lifting for you: They have a built in clock so they multiplex the display. They use constant-current drivers for ultra-bright, consistent color (the images above are photographed at the dimmest setting to avoid overloading our camera!), 1/16 step display dimming, all via a simple I2C interface. The backpacks come with address-selection jumpers so you can connect up to four mini 8x8's or eight 7-segments (or a combination, such as four mini 8x8's and four 7-segments, etc) on a single I2C bus.

The product kit comes with a fully tested and assembled LED backpack, a 4-pin header and the matrix of your choice. A bit of soldering is required to attach the matrix onto the backpack but it's very easy to do and only takes about 5 minutes.

Of course, in classic Adafruit fashion, we also have a detailed tutorial showing you how to solder, wire and control the display. We even wrote a very nice library for the backpacks so you can get running in under half an hour, displaying images on the matrix or numbers on the 7-segment. If you've been eyeing matrix displays but hesitated because of the complexity, his is the solution you've been looking for!

# Adafruit LED Backpacks

## 1.2" 8x8 Matrix

This version of the LED backpack is designed for the 1.2" 8x8 matrices. They measure only 1.2"x1.2" so its a shame to use a massive array of chips to control it. This backpack solves the annoyance of using 16 pins or a bunch of chips by having an I2C constant-current matrix controller sit neatly on the back of the PCB. The controller chip takes care of everything, drawing all 64 LEDs in the background. All you have to do is write data to it using the 2-pin I2C interface. There are two address select pins so you can select one of 8 addresses to control up to 8 of these on a single 2-pin I2C bus (as well as whatever other I2C chips or sensors you like). The driver chip can 'dim' the entire display from 1/16 brightness up to full brightness in 1/16th steps. It cannot dim individual LEDs, only the entire display at once.

![](https://cdn-learn.adafruit.com/assets/assets/000/086/928/medium800/led_matrices_1052-00.jpg?1579124826)

# Adafruit LED Backpacks

## Assembly

Danger: 

When you buy a pack from Adafruit, it comes with the fully tested and assembled backpack as well as a 8x8 matrix in one of the colors we provide (say, red, yellow or green). You'll need to solder the matrix onto the backpack but its an easy task.

![led_matrix_ID1052parts_LRG.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/110/medium640/led_matrix_ID1052parts_LRG.jpg?1396779451)

 **WATCH OUT! THE MATRIX MUST BE INSTALLED THE RIGHT WAY!**  
  
First look for the line of text on the side of the LED matrix  
![led_matrix_text.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/111/medium640/led_matrix_text.jpg?1396779452)

 **WATCH OUT! THE MATRIX MUST BE INSTALLED THE RIGHT WAY!**  
  
Find the corner of the backpack with a filled in dot. Make sure that the text on the side of the matrix is on the same side as the filled dot  
![led_matrix_dot.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/112/medium640/led_matrix_dot.jpg?1396779459)

 **WATCH OUT! THE MATRIX MUST BE INSTALLED THE RIGHT WAY!**  
  
Slide the matrix into the backpack and flip it over. Triple check that the text is on the same side as the **From Adafruit** text  
![led_matrix_align.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/113/medium640/led_matrix_align.jpg?1396779465)

Solder in all 16 pins  
  
Then clip the matrix leads short

![led_matrix_soldering.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/114/medium640/led_matrix_soldering.jpg?1396779471)

![led_matrix_soldered.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/115/medium640/led_matrix_soldered.jpg?1396779476)

![led_matrix_clip.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/116/medium640/led_matrix_clip.jpg?1396779485)

Now you're ready to wire it up to a microcontroller. We'll assume you want to use a 4pin header. You can also of course solder wires directly. Place a 4-pin piece of header with the LONG pins down into the breadboard.  
![led_matrix_legsdown.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/117/medium640/led_matrix_legsdown.jpg?1396779493)

Place the soldered backpack on top of the header.  
  
Solder the four pins  
![led_matrix_headerplce.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/118/medium640/led_matrix_headerplce.jpg?1396779502)

![led_matrix_headersolder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/002/119/medium640/led_matrix_headersolder.jpg?1396779512)

That's it! now you're ready to run the firmware!

# Adafruit LED Backpacks

## Arduino Setup

Primary: 

## Mini 8x8 Matrix Software

We wrote a basic library to help you work with the mini 8x8 matrix backpack. The library is written for the Arduino and will work with any Arduino as it just uses the I2C pins. The code is very portable and can be easily adapted to any I2C-capable micro.

Wiring to the matrix is really easy

- Connect&nbsp; **CLK** to the I2C clock - on Arduino UNO thats Analog #5 (or SCL), on the Leonardo its Digital #3, on the Mega its digital #21
- Connect&nbsp; **DAT** to the I2C data - on Arduino UNO thats Analog #4 (or SDA), on the Leonardo its Digital #2, on the Mega its digital #20
- Connect&nbsp; **GND** &nbsp;to common ground
- Connect&nbsp; **VCC+** &nbsp;to power - 5V is best but 3V also seems to work for 3V microcontrollers.

Next, download the&nbsp; **Adafruit LED Backpack&nbsp;** library and the&nbsp; **Adafruit GFX&nbsp;** library from the Arduino library manager.

Open up the Arduino library manager:

![](https://cdn-learn.adafruit.com/assets/assets/000/084/462/medium800/led_matrices_1library_manager_menu.png?1574046587)

Search for the&nbsp; **Adafruit LED Backpack&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/463/medium800/led_matrices_led_backpack.png?1574046689)

Search for the&nbsp; **Adafruit GFX&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/464/medium800/led_matrices_gfx.png?1574046746)

If using an earlier version of the Arduino IDE (prior to 1.8.10), also locate and install **Adafruit\_BusIO** (newer versions will install this dependency automatically).

You should now be able to select the **File→Examples→Adafruit\_LEDBackpack→matrix88** example sketch. Upload it to your Arduino as usual. You should see a basic test program that goes through a bunch of different drawing routine

We also have a great tutorial on Arduino library installation at:  
[http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use "Link: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use")

![](https://cdn-learn.adafruit.com/assets/assets/000/002/120/medium800/led_matrix_ID1052_LRG.jpg?1396779519)

Once you're happy that the matrix works, you can write your own sketches. The 8x8 matrix supports everything the Adafruit GFX library - drawing pixels, lines, rectancles, circles, triangles, roundrects, and small bitmaps. [For more details check out the GFX page which will detail all of the GFX routines](http://learn.adafruit.com/adafruit-gfx-graphics-library).

All the drawing routines only change the display memory kept by the Arduino. Don't forget to call **writeDisplay()** after drawing to 'save' the memory out to the matrix via I2C.

There are also a few small routines that are special to the matrix:

- **setBrightness(_brighness_)**- will let you change the overall brightness of the entire display. 0 is least bright, 15 is brightest and is what is initialized by the display when you start. You can call this function at any time to change the brightness of the -entire- display  
- **blinkRate(_rate_)** - You can blink the entire display. 0 is no blinking. 1, 2 or 3 is for display blinking.You can call this function at any time to change the blink rate of the -entire- display

  
The default orientation for graphics commands on this display places pixel (0,0) at the top-left when the header is at the left and Adafruit logo at the right. To use the matrix as shown above (header at top, logo at bottom), call matrix.setRotation(3) before issuing graphics commands.

![led_matrix_small-orient.jpg](https://cdn-learn.adafruit.com/assets/assets/000/010/757/medium640/led_matrix_small-orient.jpg?1378179335)

# Adafruit LED Backpacks

## CircuitPython Wiring and Setup

# Wiring

It's easy to use LED Matrices with CircuitPython and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This module allows you to easily write CircuitPython code to control the display.

You can use this sensor with any CircuitPython microcontroller board.

We'll cover how to wire the LED Matrix to your CircuitPython microcontroller board. First assemble your LED Matrix.

Connect the LED Matrix to your microcontroller board as shown below.

- **Microcontroller 3V&nbsp;** to **LED Matrix VIN**
- **Microcontroller GND&nbsp;** to **LED Matrix&nbsp;GND**
- **Microcontroller SCL&nbsp;** to **LED Matrix&nbsp;SCL**
- **Microcontroller SDA&nbsp;** to **LED Matrix&nbsp;SDA**

![led_matrices_feather-m4-1.2-8x8_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/929/medium640/led_matrices_feather-m4-1.2-8x8_bb.jpg?1579126657)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/087/060/original/feather-m4-1.2-8x8.fzz?1579283216)
# Library Setup

To use the LED backpack&nbsp;with your&nbsp;[Adafruit CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/overview)&nbsp;board you'll need to install the&nbsp;[Adafruit\_CircuitPython\_HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library on your board.

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://github.com/adafruit/circuitpython/releases)&nbsp;for your board. &nbsp;Next you'll need to install the necessary libraries&nbsp;to use the hardware--read below and carefully follow the referenced steps to find and install these libraries from [Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).

## Bundle Install

For express boards that have extra flash storage, like the Feather/Metro M0 express and Circuit Playground express, you can easily install the necessary libraries with [Adafruit's CircuitPython bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle). &nbsp;This is an all-in-one package that includes the necessary libraries to use the LED backpack display with CircuitPython. For details on installing the bundle, read about [CircuitPython Libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

Remember for non-express boards like the Trinket M0, Gemma M0, and Feather/Metro M0 basic you'll need to [manually install the necessary libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries#non-express-boards-11-13) from the bundle:

- **adafruit\_ht16k33**
- **adafruit\_bus\_device**

If your board supports USB mass storage, like the M0-based boards, then simply drag the files to the board's file system.&nbsp;**Note on boards without external SPI flash, like a Feather M0 or Trinket/Gemma M0, you might run into issues on Mac OSX with hidden files taking up too much space when drag and drop copying,&nbsp;[see this page for a workaround](../../../../micropython-for-samd21/usb-mass-storage#mac-osx-file-copy-issues).**

Before continuing make sure your board's **lib** folder or root filesystem has at least the&nbsp; **adafruit\_ht16k33** and&nbsp; **adafruit\_bus\_device** &nbsp;folders/modules copied over.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/098/medium800/led_matrices_circuitpy.png?1579297124)

# Adafruit LED Backpacks

## Python Wiring and Setup

# Wiring

It's easy to use LED Matrices with Python and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This library allows you to easily write Python code to control the display.

We'll cover how to wire the LED Matrix to your Raspberry Pi. First assemble your LED Matrix.

Since there's _dozens_ of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Connect the LED Matrix as shown below to your Raspberry Pi.

- **Raspberry Pi 3.3V&nbsp;** to **&nbsp;LED Matrix VIN**
- **Raspberry Pi GND&nbsp;** to **LED Matrix&nbsp;GND**
- **Raspberry Pi SCL&nbsp;** to **LED Matrix&nbsp;SCL**
- **Raspberry Pi SDA&nbsp;** to **LED Matrix&nbsp;SDA**

![led_matrices_raspberry-pi-1.2-8x8_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/930/medium640/led_matrices_raspberry-pi-1.2-8x8_bb.jpg?1579126784)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/087/061/original/raspberry-pi-1.2-8x8.fzz?1579283236)
# Setup

You'll need to install the Adafruit\_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

## Python Installation of HT16K33 Library

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-ht16k33`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

If that complains about pip3 not being installed, then run this first to install it:

- `sudo apt-get install python3-pip`

## Pillow Library

We also need PIL, the Python Imaging Library, to allow using text with custom fonts. There are several system libraries that PIL relies on, so installing via a package manager is the easiest way to bring in everything:

- `sudo apt-get install python3-pil`

That's it. You should be ready to go.

# Adafruit LED Backpacks

## CircuitPython and Python Usage

The following section will show how to control the LED backpack&nbsp;from the board's Python prompt / REPL. &nbsp;You'll walk through how to control the LED display and learn how to use the CircuitPython module built for the display.

First&nbsp;[connect to the board's serial REPL&nbsp;](https://learn.adafruit.com/welcome-to-circuitpython/the-repl)so you are at the CircuitPython&nbsp; **\>\>\>** &nbsp;prompt.

## Initialization

First you'll need to initialize the I2C bus for your board.&nbsp; It's really easy, first import the necessary modules. In this case, we'll use `board` and `Matrix8x8`.

Then just use `board.I2C()` to create the I2C instance using the default SCL and SDA pins (which will be marked on the boards pins if using a Feather or similar Adafruit board).

Then to initialize the matrix, you just pass `i2c` in.

Warning: When using the STEMMA QT port, some board may have an alternate I2C such as board.STEMMA_I2C().

```python
import board
from adafruit_ht16k33.matrix import Matrix8x8

i2c = board.I2C()
matrix = Matrix8x8(i2c)
```

If you bridged the address pads on the back of the display, you could pass in the address. The addresses for the HT16K33 can range between 0x70 and 0x77 depending on which pads you have bridged, with 0x70 being used if you haven't bridged any of them. For instance, if you bridge only the **A0** pad, you would use `0x71` like this:

```python
matrix = Matrix8x8(i2c, address=0x71)
```

## Setting the Brightness

You can set the brightness of the display, but changing it will set the brightness of the entire display and not individual segments. If can be adjusted in 1/16 increments **between 0 and 1.0** with 1.0 being the brightest. So to set the display to half brightness, you would use the following:

```python
matrix.brightness = 0.5
```

## Setting the Blink Rate

You can set the blink rate of the display, but changing it will set the brightness of the entire display and not individual pixels. If can be adjusted in 1/4 increments&nbsp; **between 0 and 3** &nbsp;with 3 being the fastest blinking. So to set the display to blink at full speed, you would use the following:

```python
matrix.blink_rate = 3
```

## Setting Individual Pixels

To set individual pixels to on, you simply treat the `matrix` object as a multidimensional list and set it to 1.

```python
matrix[0, 0] = 1
matrix[4, 4] = 1
matrix[7, 7] = 1
```

## Filling the Entire Matrix

To fill the entire matrix, just use the fill() function and pass in either 0 or 1 depending on whether you want all pixels off or on. For instance, if you wanted to set everything to on, you would use:

```python
matrix.fill(1)
```

## Shifting the Matrix

To shift the pixels on the matrix, there are 5 functions you can use. The main function, called shift(), is used to shift the pixels, up, down, left, right, or even diagonally. By passing a positive number, it will shift the pixels right/up and passing a negative number will shift them left/down. For instance:

```python
matrix.shift(2, 0)	# shift pixels to the right by 2
matrix.shift(-1, 0)	# shift pixels to the left by 1
matrix.shift(0, -3)	# shift pixels down by 3
matrix.shift(-2, 2)	# shift pixels left by 2 and up by 2
```

You can pass `True` as a third parameter to loop all the pixels that get shifted off over to the other side.

```python
matrix.shift(2, 0, True)	# loop pixels to the right by 2
matrix.shift(-1, 0, True)	# loop pixels to the left by 1
matrix.shift(0, -3, True)	# loop pixels down by 3
matrix.shift(-2, 2, True)	# loop pixels left by 2 and up by 2
```

Additionally, there are a few convenience functions that will shift the pixels by one. These can also be passed a value of `True` to loop the pixels.

```python
matrix.shift_up()		# Shift pixels up
matrix.shift_left()		# Shift pixels left
matrix.shift_down()		# Shift pixels down
matrix.shift_right()		# Shift pixels right
matrix.shift_up(True)		# Loop pixels up
matrix.shift_left(True)	# Loop pixels left
matrix.shift_down(True)	# Loop pixels down
matrix.shift_right(True)	# Loop pixels right
```

## Displaying an Image (Pillow Only)

Additionally, when using with the Raspberry Pi, you can use the Pillow library to display an image to the Matrix. The image will need to be the same exact size as the Matrix. In this case, it should be **8x8** pixels. As an example, you can save the image below as&nbsp; **myimage.png**.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/758/medium800/led_matrices_squares-mono-8x8.png?1580238605)

[Download Image](https://cdn-learn.adafruit.com/assets/assets/000/087/758/original/led_matrices_squares-mono-8x8.png?1580238605)
Then if you want to display the image called&nbsp; **myimage.png** , you would use something like this:

```python
import board
from PIL import Image
from adafruit_ht16k33 import matrix

matrix = matrix.Matrix8x8(board.I2C())

image = Image.open("myimage.png")
matrix.image(image)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/087/757/medium800/led_matrices_IMG_1547.jpeg?1580238587)

# Adafruit LED Backpacks

## 0.8" 8x8 Matrix

This version of the LED backpack is designed for these very cute miniature 8x8 matrices. They measure only 0.8"x0.8" so its a shame to use a massive array of chips to control it. This backpack solves the annoyance of using 16 pins or a bunch of chips by having an I2C constant-current matrix controller sit neatly on the back of the PCB. The controller chip takes care of everything, drawing all 64 LEDs in the background. All you have to do is write data to it using the 2-pin I2C interface. There are two address select pins so you can select one of 4 addresses to control up to 4 of these on a single 2-pin I2C bus (as well as whatever other I2C chips or sensors you like). The driver chip can 'dim' the entire display from 1/16 brightness up to full brightness in 1/16th steps. It cannot dim individual LEDs, only the entire display at once.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/051/medium800/led_matrices_872-00.jpg?1579279224)

# Adafruit LED Backpacks

## Assembly

Danger: 

When you buy a pack from Adafruit, it comes with the fully tested and assembled backpack as well as a 8x8 matrix in one of the colors we provide (say, red, yellow or green). You'll need to solder the matrix onto the backpack but its an easy task.

![led_matrix_front88.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/139/medium640/led_matrix_front88.jpg?1396760727)

Remove the parts from packaging and place the LED matrix OVER the silkscreen side. It can go 'either way' - the matrix is symmetric so as long as it goes onto the front it will work in any orientation. Do not solder the matrix over the chip on the back of the backpack - it will not work then!![led_matrix_side88.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/140/medium640/led_matrix_side88.jpg?1396760732)

Turn the backpack over so its sitting flat on the matrix.![led_matrix_place88.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/141/medium640/led_matrix_place88.jpg?1396760739)

Solder all 16 pins.![led_matrix_solder88.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/142/medium640/led_matrix_solder88.jpg?1396760747)

Clip the long pins.![led_matrix_clip88.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/143/medium640/led_matrix_clip88.jpg?1396760753)

![led_matrix_soldered88.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/144/medium640/led_matrix_soldered88.jpg?1396760762)

Now you're ready to wire it up to a microcontroller. We'll assume you want to use a 4pin header. You can also of course solder wires directly. Place a 4-pin piece of header with the LONG pins down into the breadboard.![led_matrix_place4pin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/145/medium640/led_matrix_place4pin.jpg?1396760766)

Place the soldered backpack on top of the header.![led_matrix_place88header.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/146/medium640/led_matrix_place88header.jpg?1396760773)

Solder 'em!![led_matrix_solder88header.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/147/medium640/led_matrix_solder88header.jpg?1396760780)

That's it! now you're ready to run the firmware!# Adafruit LED Backpacks

## Arduino Wiring and Setup

Primary: 

We wrote a basic library to help you work with the mini 8x8 matrix backpack. The library is written for the Arduino and will work with any Arduino as it just uses the I2C pins. The code is very portable and can be easily adapted to any I2C-capable micro.

Wiring to the matrix is really easy

- Connect&nbsp; **CLK** to the I2C clock - on Arduino UNO thats Analog #5 (or SCL), on the Leonardo its Digital #3, on the Mega its digital #21
- Connect&nbsp; **DAT** to the I2C data - on Arduino UNO thats Analog #4 (or SDA), on the Leonardo its Digital #2, on the Mega its digital #20
- Connect&nbsp; **GND** &nbsp;to common ground
- Connect&nbsp; **VCC+** &nbsp;to power - 5V is best but 3V also seems to work for 3V microcontrollers.

Next, download the&nbsp; **Adafruit LED Backpack&nbsp;** library and the&nbsp; **Adafruit GFX&nbsp;** library from the Arduino library manager.

Open up the Arduino library manager:

![](https://cdn-learn.adafruit.com/assets/assets/000/084/465/medium800/led_matrices_1library_manager_menu.png?1574046876)

Search for the&nbsp; **Adafruit LED Backpack** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/466/medium800/led_matrices_led_backpack.png?1574047371)

Search for the&nbsp; **Adafruit GFX&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/467/medium800/led_matrices_gfx.png?1574047387)

If using an earlier version of the Arduino IDE (prior to 1.8.10), also locate and install **Adafruit\_BusIO** (newer versions will install this dependency automatically).

Once you've restarted you should be able to select the **File→Examples→Adafruit\_LEDBackpack→matrix88** example sketch. Upload it to your Arduino as usual. You should see a basic test program that goes through a bunch of different drawing routines

We also have a great tutorial on Arduino library installation at:  
[http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use "Link: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use")

![](https://cdn-learn.adafruit.com/assets/assets/000/000/165/medium800/led_matrix_ID871_LRG.jpg?1396760904)

Once you're happy that the matrix works, you can write your own sketches. The 8x8 matrix supports everything the Adafruit GFX library - drawing pixels, lines, rectancles, circles, triangles, roundrects, and small bitmaps. [For more details check out the GFX page which will detail all of the GFX routines](http://learn.adafruit.com/adafruit-gfx-graphics-library).

All the drawing routines only change the display memory kept by the Arduino. Don't forget to call **writeDisplay()** after drawing to 'save' the memory out to the matrix via I2C.

There are also a few small routines that are special to the matrix:

- **setBrightness(_brighness_)**- will let you change the overall brightness of the entire display. 0 is least bright, 15 is brightest and is what is initialized by the display when you start
- **blinkRate(_rate_)** - You can blink the entire display. 0 is no blinking. 1, 2 or 3 is for display blinking.  

# Adafruit LED Backpacks

## CircuitPython Wiring and Setup

# Wiring

It's easy to use LED Matrices with CircuitPython and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This module allows you to easily write CircuitPython code to control the display.

You can use this sensor with any CircuitPython microcontroller board.

We'll cover how to wire the LED Matrix to your CircuitPython microcontroller board. First assemble your LED Matrix.

Connect the LED Matrix to your microcontroller board as shown below.

- **Microcontroller 3V&nbsp;** to **LED Matrix VIN**
- **Microcontroller GND&nbsp;** to **LED Matrix&nbsp;GND**
- **Microcontroller SCL&nbsp;** to **LED Matrix&nbsp;SCL**
- **Microcontroller SDA&nbsp;** to **LED Matrix&nbsp;SDA**

![led_matrices_feather-m4-1.2-8x8_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/929/medium640/led_matrices_feather-m4-1.2-8x8_bb.jpg?1579126657)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/087/060/original/feather-m4-1.2-8x8.fzz?1579283216)
# Library Setup

To use the LED backpack&nbsp;with your&nbsp;[Adafruit CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/overview)&nbsp;board you'll need to install the&nbsp;[Adafruit\_CircuitPython\_HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library on your board.

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://github.com/adafruit/circuitpython/releases)&nbsp;for your board. &nbsp;Next you'll need to install the necessary libraries&nbsp;to use the hardware--read below and carefully follow the referenced steps to find and install these libraries from [Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).

## Bundle Install

For express boards that have extra flash storage, like the Feather/Metro M0 express and Circuit Playground express, you can easily install the necessary libraries with [Adafruit's CircuitPython bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle). &nbsp;This is an all-in-one package that includes the necessary libraries to use the LED backpack display with CircuitPython. For details on installing the bundle, read about [CircuitPython Libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

Remember for non-express boards like the Trinket M0, Gemma M0, and Feather/Metro M0 basic you'll need to [manually install the necessary libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries#non-express-boards-11-13) from the bundle:

- **adafruit\_ht16k33**
- **adafruit\_bus\_device**

If your board supports USB mass storage, like the M0-based boards, then simply drag the files to the board's file system.&nbsp;**Note on boards without external SPI flash, like a Feather M0 or Trinket/Gemma M0, you might run into issues on Mac OSX with hidden files taking up too much space when drag and drop copying,&nbsp;[see this page for a workaround](../../../../micropython-for-samd21/usb-mass-storage#mac-osx-file-copy-issues).**

Before continuing make sure your board's **lib** folder or root filesystem has at least the&nbsp; **adafruit\_ht16k33** and&nbsp; **adafruit\_bus\_device** &nbsp;folders/modules copied over.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/098/medium800/led_matrices_circuitpy.png?1579297124)

# Adafruit LED Backpacks

## Python Wiring and Setup

# Wiring

It's easy to use LED Matrices with Python and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This library allows you to easily write Python code to control the display.

We'll cover how to wire the LED Matrix to your Raspberry Pi. First assemble your LED Matrix.

Since there's _dozens_ of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Connect the LED Matrix as shown below to your Raspberry Pi.

- **Raspberry Pi 3.3V&nbsp;** to **&nbsp;LED Matrix VIN**
- **Raspberry Pi GND&nbsp;** to **LED Matrix&nbsp;GND**
- **Raspberry Pi SCL&nbsp;** to **LED Matrix&nbsp;SCL**
- **Raspberry Pi SDA&nbsp;** to **LED Matrix&nbsp;SDA**

![led_matrices_raspberry-pi-1.2-8x8_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/930/medium640/led_matrices_raspberry-pi-1.2-8x8_bb.jpg?1579126784)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/087/061/original/raspberry-pi-1.2-8x8.fzz?1579283236)
# Setup

You'll need to install the Adafruit\_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

## Python Installation of HT16K33 Library

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-ht16k33`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

If that complains about pip3 not being installed, then run this first to install it:

- `sudo apt-get install python3-pip`

## Pillow Library

We also need PIL, the Python Imaging Library, to allow using text with custom fonts. There are several system libraries that PIL relies on, so installing via a package manager is the easiest way to bring in everything:

- `sudo apt-get install python3-pil`

That's it. You should be ready to go.

# Adafruit LED Backpacks

## CircuitPython and Python Usage

The following section will show how to control the LED backpack&nbsp;from the board's Python prompt / REPL. &nbsp;You'll walk through how to control the LED display and learn how to use the CircuitPython module built for the display.

First&nbsp;[connect to the board's serial REPL&nbsp;](https://learn.adafruit.com/welcome-to-circuitpython/the-repl)so you are at the CircuitPython&nbsp; **\>\>\>** &nbsp;prompt.

## Initialization

First you'll need to initialize the I2C bus for your board.&nbsp; It's really easy, first import the necessary modules. In this case, we'll use `board` and `Matrix8x8`.

Then just use `board.I2C()` to create the I2C instance using the default SCL and SDA pins (which will be marked on the boards pins if using a Feather or similar Adafruit board).

Then to initialize the matrix, you just pass `i2c` in.

Warning: When using the STEMMA QT port, some board may have an alternate I2C such as board.STEMMA_I2C().

```python
import board
from adafruit_ht16k33.matrix import Matrix8x8

i2c = board.I2C()
matrix = Matrix8x8(i2c)
```

If you bridged the address pads on the back of the display, you could pass in the address. The addresses for the HT16K33 can range between 0x70 and 0x77 depending on which pads you have bridged, with 0x70 being used if you haven't bridged any of them. For instance, if you bridge only the **A0** pad, you would use `0x71` like this:

```python
matrix = Matrix8x8(i2c, address=0x71)
```

## Setting the Brightness

You can set the brightness of the display, but changing it will set the brightness of the entire display and not individual segments. If can be adjusted in 1/16 increments **between 0 and 1.0** with 1.0 being the brightest. So to set the display to half brightness, you would use the following:

```python
matrix.brightness = 0.5
```

## Setting the Blink Rate

You can set the blink rate of the display, but changing it will set the brightness of the entire display and not individual pixels. If can be adjusted in 1/4 increments&nbsp; **between 0 and 3** &nbsp;with 3 being the fastest blinking. So to set the display to blink at full speed, you would use the following:

```python
matrix.blink_rate = 3
```

## Setting Individual Pixels

To set individual pixels to on, you simply treat the `matrix` object as a multidimensional list and set it to 1.

```python
matrix[0, 0] = 1
matrix[4, 4] = 1
matrix[7, 7] = 1
```

## Filling the Entire Matrix

To fill the entire matrix, just use the fill() function and pass in either 0 or 1 depending on whether you want all pixels off or on. For instance, if you wanted to set everything to on, you would use:

```python
matrix.fill(1)
```

## Shifting the Matrix

To shift the pixels on the matrix, there are 5 functions you can use. The main function, called shift(), is used to shift the pixels, up, down, left, right, or even diagonally. By passing a positive number, it will shift the pixels right/up and passing a negative number will shift them left/down. For instance:

```python
matrix.shift(2, 0)	# shift pixels to the right by 2
matrix.shift(-1, 0)	# shift pixels to the left by 1
matrix.shift(0, -3)	# shift pixels down by 3
matrix.shift(-2, 2)	# shift pixels left by 2 and up by 2
```

You can pass `True` as a third parameter to loop all the pixels that get shifted off over to the other side.

```python
matrix.shift(2, 0, True)	# loop pixels to the right by 2
matrix.shift(-1, 0, True)	# loop pixels to the left by 1
matrix.shift(0, -3, True)	# loop pixels down by 3
matrix.shift(-2, 2, True)	# loop pixels left by 2 and up by 2
```

Additionally, there are a few convenience functions that will shift the pixels by one. These can also be passed a value of `True` to loop the pixels.

```python
matrix.shift_up()		# Shift pixels up
matrix.shift_left()		# Shift pixels left
matrix.shift_down()		# Shift pixels down
matrix.shift_right()		# Shift pixels right
matrix.shift_up(True)		# Loop pixels up
matrix.shift_left(True)	# Loop pixels left
matrix.shift_down(True)	# Loop pixels down
matrix.shift_right(True)	# Loop pixels right
```

## Displaying an Image (Pillow Only)

Additionally, when using with the Raspberry Pi, you can use the Pillow library to display an image to the Matrix. The image will need to be the same exact size as the Matrix. In this case, it should be **8x8** pixels. As an example, you can save the image below as&nbsp; **myimage.png**.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/758/medium800/led_matrices_squares-mono-8x8.png?1580238605)

[Download Image](https://cdn-learn.adafruit.com/assets/assets/000/087/758/original/led_matrices_squares-mono-8x8.png?1580238605)
Then if you want to display the image called&nbsp; **myimage.png** , you would use something like this:

```python
import board
from PIL import Image
from adafruit_ht16k33 import matrix

matrix = matrix.Matrix8x8(board.I2C())

image = Image.open("myimage.png")
matrix.image(image)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/087/757/medium800/led_matrices_IMG_1547.jpeg?1580238587)

# Adafruit LED Backpacks

## 1.2" 16x8 Matrix

With the 16x8 LED Matrix we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto one handy board! This version of the LED backpack is designed for two of the 1.2" 8x8 matrices. They measure only 1.2"x1.2" so its a shame to use a massive array of chips to control it. This backpack solves the annoyance of using 32 pins or a bunch of chips by having an I2C constant-current matrix controller sit neatly on the back of the PCB. The controller chip takes care of everything, drawing all 128 LEDs in the background. All you have to do is write data to it using the 2-pin I2C interface. There are two address select pins so you can select one of 8 addresses to control up to 8 of these on a single 2-pin I2C bus (as well as whatever other I2C chips or sensors you like). The driver chip can 'dim' the entire display from 1/16 brightness up to full brightness in 1/16th steps. It cannot dim individual LEDs, only the entire display at once.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/053/medium800/led_matrices_2037-02.jpg?1579281327)

Assembling the 1.2" 16x8 backpack is nearly the same as the 1.2" 8x8, so you can [follow that page](https://learn.adafruit.com/adafruit-led-backpack/1-2-8x8-matrix-assembly) for directions,&nbsp;only difference is there’s two matrices to install now.

The printed-on edge of the matrices face the white dots on the PCB, and there’s a single set of address selection pads; the pair is addressed as one larger unit, not set independently.

![](https://cdn-learn.adafruit.com/assets/assets/000/114/221/medium800/led_matrices_Twin-Matrix-Assembly.jpg?1660663755)

# Adafruit LED Backpacks

## Arduino Setup

Primary: 

## 16x8 Matrix Software

We wrote a basic library to help you work with the 16x8 matrix backpack. The library is written for the Arduino and will work with any Arduino as it just uses the I2C pins. The code is very portable and can be easily adapted to any I2C-capable micro.

Wiring to the matrix is really easy

- Connect&nbsp; **CLK** to the I2C clock - on Arduino UNO thats Analog #5 (or SCL), on the Leonardo its Digital #3, on the Mega its digital #21
- Connect&nbsp; **DAT** to the I2C data - on Arduino UNO thats Analog #4 (or SDA), on the Leonardo its Digital #2, on the Mega its digital #20
- Connect&nbsp; **GND** &nbsp;to common ground
- Connect&nbsp; **VCC+** &nbsp;to power - 5V is best but 3V also seems to work for 3V microcontrollers.

Next, download the&nbsp; **Adafruit LED Backpack&nbsp;** library and the&nbsp; **Adafruit GFX&nbsp;** library from the Arduino library manager.

Open up the Arduino library manager:

![](https://cdn-learn.adafruit.com/assets/assets/000/084/462/medium800/led_matrices_1library_manager_menu.png?1574046587)

Search for the&nbsp; **Adafruit LED Backpack&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/463/medium800/led_matrices_led_backpack.png?1574046689)

Search for the&nbsp; **Adafruit GFX&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/464/medium800/led_matrices_gfx.png?1574046746)

If using an earlier version of the Arduino IDE (prior to 1.8.10), also locate and install **Adafruit\_BusIO** (newer versions will install this dependency automatically).

You should now be able to select the **File→Examples→Adafruit\_LEDBackpack→matrix88** example sketch. Upload it to your Arduino as usual. You should see a basic test program that goes through a bunch of different drawing routine

We also have a great tutorial on Arduino library installation at:  
[http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use "Link: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use")

![](https://cdn-learn.adafruit.com/assets/assets/000/087/055/medium800/led_matrices_2035-04.jpg?1579281478)

Once you're happy that the matrix works, you can write your own sketches. The 8x8 matrix supports everything the Adafruit GFX library - drawing pixels, lines, rectancles, circles, triangles, roundrects, and small bitmaps. [For more details check out the GFX page which will detail all of the GFX routines](http://learn.adafruit.com/adafruit-gfx-graphics-library).

All the drawing routines only change the display memory kept by the Arduino. Don't forget to call **writeDisplay()** after drawing to 'save' the memory out to the matrix via I2C.

There are also a few small routines that are special to the matrix:

- **setBrightness(_brighness_)**- will let you change the overall brightness of the entire display. 0 is least bright, 15 is brightest and is what is initialized by the display when you start. You can call this function at any time to change the brightness of the -entire- display  
- **blinkRate(_rate_)** - You can blink the entire display. 0 is no blinking. 1, 2 or 3 is for display blinking.You can call this function at any time to change the blink rate of the -entire- display

  
The default orientation for graphics commands on this display places pixel (0,0) at the top-left when the header is at the left and Adafruit logo at the right. To use the matrix as shown above (header at top, logo at bottom), call matrix.setRotation(3) before issuing graphics commands.

![led_matrix_small-orient.jpg](https://cdn-learn.adafruit.com/assets/assets/000/010/757/medium640/led_matrix_small-orient.jpg?1378179335)

# Adafruit LED Backpacks

## CircuitPython Wiring and Setup

# Wiring

It's easy to use LED Matrices with CircuitPython and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This module allows you to easily write CircuitPython code to control the display.

You can use this sensor with any CircuitPython microcontroller board.

We'll cover how to wire the LED Matrix to your CircuitPython microcontroller board. First assemble your LED Matrix.

Connect the LED Matrix to your microcontroller board as shown below.

- **Microcontroller 3V&nbsp;** to **LED Matrix VIN**
- **Microcontroller GND&nbsp;** to **LED Matrix&nbsp;GND**
- **Microcontroller SCL&nbsp;** to **LED Matrix&nbsp;SCL**
- **Microcontroller SDA&nbsp;** to **LED Matrix&nbsp;SDA**

![led_matrices_feather-m4-1.2-16x8_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/087/056/medium640/led_matrices_feather-m4-1.2-16x8_bb.jpg?1579283093)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/087/059/original/feather-m4-1.2-16x8.fzz?1579283184)
# Library Setup

To use the LED backpack&nbsp;with your&nbsp;[Adafruit CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/overview)&nbsp;board you'll need to install the&nbsp;[Adafruit\_CircuitPython\_HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library on your board.

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://github.com/adafruit/circuitpython/releases)&nbsp;for your board. &nbsp;Next you'll need to install the necessary libraries&nbsp;to use the hardware--read below and carefully follow the referenced steps to find and install these libraries from [Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).

## Bundle Install

For express boards that have extra flash storage, like the Feather/Metro M0 express and Circuit Playground express, you can easily install the necessary libraries with [Adafruit's CircuitPython bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle). &nbsp;This is an all-in-one package that includes the necessary libraries to use the LED backpack display with CircuitPython. For details on installing the bundle, read about [CircuitPython Libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

Remember for non-express boards like the Trinket M0, Gemma M0, and Feather/Metro M0 basic you'll need to [manually install the necessary libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries#non-express-boards-11-13) from the bundle:

- **adafruit\_ht16k33**
- **adafruit\_bus\_device**

If your board supports USB mass storage, like the M0-based boards, then simply drag the files to the board's file system.&nbsp;**Note on boards without external SPI flash, like a Feather M0 or Trinket/Gemma M0, you might run into issues on Mac OSX with hidden files taking up too much space when drag and drop copying,&nbsp;[see this page for a workaround](../../../../micropython-for-samd21/usb-mass-storage#mac-osx-file-copy-issues).**

Before continuing make sure your board's **lib** folder or root filesystem has at least the&nbsp; **adafruit\_ht16k33** and&nbsp; **adafruit\_bus\_device** &nbsp;folders/modules copied over.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/099/medium800/led_matrices_circuitpy.png?1579297155)

# Adafruit LED Backpacks

## Python Wiring and Setup

# Wiring

It's easy to use LED Matrices with Python and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This library allows you to easily write Python code to control the display.

We'll cover how to wire the LED Matrix to your Raspberry Pi. First assemble your LED Matrix.

Since there's _dozens_ of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Connect the LED Matrix as shown below to your Raspberry Pi.

- **Raspberry Pi 3.3V&nbsp;** to **LED Matrix&nbsp;VIN**
- **Raspberry Pi GND&nbsp;** to **LED Matrix&nbsp;GND**
- **Raspberry Pi SCL&nbsp;** to **LED Matrix&nbsp;SCL**
- **Raspberry Pi SDA&nbsp;** to **LED Matrix&nbsp;SDA**

![led_matrices_raspberry-pi-1.2-16x8_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/087/535/medium640/led_matrices_raspberry-pi-1.2-16x8_bb.jpg?1579983315)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/087/305/original/raspberry-pi-alphanum.fzz?1579660445)
# Setup

You'll need to install the Adafruit\_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

## Python Installation of HT16K33 Library

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-ht16k33`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

If that complains about pip3 not being installed, then run this first to install it:

- `sudo apt-get install python3-pip`

## Pillow Library

We also need PIL, the Python Imaging Library, to allow using text with custom fonts. There are several system libraries that PIL relies on, so installing via a package manager is the easiest way to bring in everything:

- `sudo apt-get install python3-pil`

That's it. You should be ready to go.

# Adafruit LED Backpacks

## CircuitPython and Python Usage

The following section will show how to control the LED backpack from the board's Python prompt / REPL. &nbsp;You'll walk through how to control the LED matrix display and learn how to use the CircuitPython module built for the display.

First, [connect to the board's serial REPL&nbsp;](https://learn.adafruit.com/welcome-to-circuitpython/the-repl)so you are at the CircuitPython&nbsp; **\>\>\>** &nbsp;prompt.

## Initialization

First you'll need to initialize the I2C bus for your board.&nbsp; It's really easy, first import the necessary modules. In this case, we'll use `board` and `MatrixBackpack16x8`.

Then just use `board.I2C()` to create the I2C instance using the default SCL and SDA pins (which will be marked on the boards pins if using a Feather or similar Adafruit board).

Then to initialize the matrix, you just pass `i2c` in.

Warning: When using the STEMMA QT port, some board may have an alternate I2C such as board.STEMMA_I2C().

```python
import board
from adafruit_ht16k33.matrix import MatrixBackpack16x8

i2c = board.I2C()
matrix = MatrixBackpack16x8(i2c)
```

If you bridged the address pads on the back of the display, you could pass in the address. The addresses for the HT16K33 can range between 0x70 and 0x77 depending on which pads you have bridged, with 0x70 being used if you haven't bridged any of them. For instance, if you bridge only the **A0** pad, you would use `0x71` like this:

```python
matrix = MatrixBackpack16x8(i2c, address=0x71)
```

## Setting the Brightness

You can set the brightness of the display, but changing it will set the brightness of the entire display and not individual segments. If can be adjusted in 1/16 increments **between 0 and 1.0** with 1.0 being the brightest. So to set the display to half brightness, you would use the following:

```python
display.brightness = 0.5
```

## Setting the Blink Rate

You can also set the blink rate of the display. It can be adjusted in increments&nbsp; **between 0 and 3** , with 3 being the slowest blinking. So to set the display to blink at the slowest speed, you would use the following:

```python
display.blink_rate = 3
```

## Setting Individual Pixels

To set individual pixels to on, you simply treat the `matrix` object as a multidimensional list and set it to 1.

```python
matrix[0, 0] = 1
matrix[4, 4] = 1
matrix[7, 7] = 1
```

## Filling the Entire Matrix

To fill the entire matrix, just use the fill() function and pass in either 0 or 1 depending on whether you want all pixels off or on. For instance, if you wanted to set everything to on, you would use:

```python
matrix.fill(1)
```

## Shifting the Matrix

To shift the pixels on the matrix, there are 5 functions you can use. The main function, called shift(), is used to shift the pixels, up, down, left, right, or even diagonally. By passing a positive number, it will shift the pixels right/up and passing a negative number will shift them left/down. For instance:

```python
matrix.shift(2, 0)	# shift pixels to the right by 2
matrix.shift(-1, 0)	# shift pixels to the left by 1
matrix.shift(0, -3)	# shift pixels down by 3
matrix.shift(-2, 2)	# shift pixels left by 2 and up by 2
```

You can pass `True` as a third parameter to loop all the pixels that get shifted off over to the other side.

```python
matrix.shift(2, 0, True)	# loop pixels to the right by 2
matrix.shift(-1, 0, True)	# loop pixels to the left by 1
matrix.shift(0, -3, True)	# loop pixels down by 3
matrix.shift(-2, 2, True)	# loop pixels left by 2 and up by 2
```

Additionally, there are a few convenience functions that will shift the pixels by one. These can also be passed a value of `True` to loop the pixels.

```python
matrix.shift_up()		# Shift pixels up
matrix.shift_left()		# Shift pixels left
matrix.shift_down()		# Shift pixels down
matrix.shift_right()		# Shift pixels right
matrix.shift_up(True)		# Loop pixels up
matrix.shift_left(True)	# Loop pixels left
matrix.shift_down(True)	# Loop pixels down
matrix.shift_right(True)	# Loop pixels right
```

Here's what shifting a smiley face to the right looks like:

![](https://cdn-learn.adafruit.com/assets/assets/000/087/536/medium800thumb/led_matrices_shift.jpg?1579985200)

## Displaying an Image (Pillow Only)

Additionally, when using with the Raspberry Pi, you can use the Pillow library to display an image to the Matrix. The image will need to be the same exact size as the Matrix. In this case, it should be **16x8** pixels. As an example, you can save the image below as&nbsp; **myimage.png**.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/760/medium800/led_matrices_squares-mono-16x8.png?1580238757)

[Download Image](https://cdn-learn.adafruit.com/assets/assets/000/087/760/original/led_matrices_squares-mono-16x8.png?1580238757)
Then if you want to display the image called&nbsp; **myimage.png** , you would use something like this:

```python
import board
from PIL import Image
from adafruit_ht16k33 import matrix

matrix = matrix.MatrixBackpack16x8(board.I2C())

image = Image.open("myimage.png")
matrix.image(image)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/087/759/medium800/led_matrices_IMG_1546.jpeg?1580238721)

# Adafruit LED Backpacks

## 0.54" Alphanumeric Backpack

This version of the LED backpack is designed for two dual 14-segment "Alphanumeric" displays. These 14-segment displays normally require 18 pins (4 'characters' and 14 total segments each) This backpack solves the annoyance of using 18 pins or a bunch of chips by having an I2C constant-current matrix controller sit neatly on the back of the PCB. The controller chip takes care of everything, drawing all the LEDs in the background. All you have to do is write data to it using the 2-pin I2C interface.   
  
There are three address select pins so you can select one of 8 addresses to control up to 8 of these on a single 2-pin I2C bus (as well as whatever other I2C chips or sensors you like). The driver chip can 'dim' the entire display from 1/16 brightness up to full brightness in 1/16th steps. It cannot dim individual LEDs, only the entire display at once.

To get you going fast, we have revised this popular board to be the same size and pinout as before but now with two&nbsp;[STEMMA QT connectors](https://learn.adafruit.com/introducing-adafruit-stemma-qt/what-is-stemma-qt)&nbsp;on either side that are compatible with the&nbsp;[SparkFun Qwiic](https://www.sparkfun.com/qwiic)&nbsp;I2C connectors. This allows you to make solderless connections between your development board and the HT16K33 or to chain it with a wide range of other sensors and accessories using a&nbsp;[**compatible cable**](https://www.adafruit.com/?q=stemma%20qt%20cable).

![](https://cdn-learn.adafruit.com/assets/assets/000/115/302/medium800thumb/led_matrices_QAB_scrolling.jpg?1663876154)

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/087/141/medium800/led_matrices_led_matrix_1912-03.jpg?1579309397)

# Adafruit LED Backpacks

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/115/303/medium800/led_matrices_QAB_pinouts_guide.jpg?1663879804)

![](https://cdn-learn.adafruit.com/assets/assets/000/115/314/medium800/led_matrices_QAB_original_pinouts_guide.jpg?1663885374)

There are a number of features on the 0.54" Alphanumeric Backpack.

# STEMMA QT Revision-Only Features

These features are only available on the STEMMA QT revision.

## STEMMA QT Connectors

The default I2C address is **0x70**.

The&nbsp;[**STEMMA QT connectors**](https://learn.adafruit.com/introducing-adafruit-stemma-qt) provide a solder-free way to connect this backpack to development boards with STEMMA QT connectors, or to other things, with[various associated accessories](https://www.adafruit.com/category/1018).

![led_matrices_QAB_STEMMA_QT.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/304/medium640/led_matrices_QAB_STEMMA_QT.jpg?1663879864)

## On LED and LED Jumper
- **On LED** - On the left side of the back of the board is a little green LED labeled **On**. This LED lights up when the board is successfully powered.
- **LED jumper** - To the right of the On LED is a jumper labeled **LED**. If you wish to disable the On LED, you can cut the trace between the two pads. To enable it again, use solder to reconnect the two pads.

![led_matrices_QAB_on_LED_and_jumper.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/313/medium640/led_matrices_QAB_on_LED_and_jumper.jpg?1663884948)

# Original and STEMMA QT Version Features

These features are available on both versions. There is one header pin difference between the two, which is explained in the next section. Everything else is the same.

## Header Pin Through-Hole Pads

If you prefer to use a breadboard, there are through-hole header pin pads along the top of the board in the middle.

The default I2C address is **0x70**.

 **On both versions:**

- **VIO/VCC** - This is power for the backpack. It can be 3V-5V. To power the backpack, give it the same power as the logic level of your microcontroller - e.g. for a 5V microcontroller like Arduino, use 5V.
- **GND** - This is common ground for power and logic.
- **SCL** - This is the I2C clock pin. Connect it to your microcontroller I2C clock line. This pin is level shifted so you can use 3-5V logic, and there's a&nbsp; **10K pullup** &nbsp;on this pin.
- **SDA** - This is the I2C data pin. Connect it to your microcontroller I2C data line. This pin is level shifted so you can use 3-5V logic, and there's a&nbsp; **10K pullup** &nbsp;on this pin.

![led_matrices_QAB_header_pins.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/305/medium640/led_matrices_QAB_header_pins.jpg?1663880455)

![led_matrices_QAB_header_pins_top.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/306/medium640/led_matrices_QAB_header_pins_top.jpg?1663880490)

![led_matrices_QAB_original_header_pins.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/307/medium640/led_matrices_QAB_original_header_pins.jpg?1663883889)

![led_matrices_QAB_original_header_pins_top.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/308/medium640/led_matrices_QAB_original_header_pins_top.jpg?1663883921)

Warning: Wiring VHi to 3v on the Stemma QT version will result in the display not activating.

 **On the STEMMA QT revision ONLY:**

- **VHi** - This pin allows you to provide 5V to only the 14-segment displays when using a 3V device to control the backpack. If you're using a 3V device and you want your displays to be brighter, you can maintain the 3V I2C power level, and connect 5V to the VHi pin to make the 14-segment displays have a brighter look.

**On the original version ONLY:**

- **Vi2c** - This is the I2C voltage, which sets the logic level to I2C. Connect this pin to the voltage pin on your device that matches the device's logic level. For example, if you're using a 3.3V microcontroller, connect it to 3.3V.

## Display Pin Through-Hole Pads
These two rows of through-hole pads are for soldering the alphanumeric LED displays onto the backpack. See the [Assembly page](https://learn.adafruit.com/adafruit-led-backpack/0-54-alphanumeric-assembly) for details on attaching the displays properly.

![led_matrices_QAB_display_pins.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/309/medium640/led_matrices_QAB_display_pins.jpg?1663884043)

![led_matrices_QAB_display_pins_top.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/310/medium640/led_matrices_QAB_display_pins_top.jpg?1663884454)

![led_matrices_QAB_original_display_pins.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/311/medium640/led_matrices_QAB_original_display_pins.jpg?1663884481)

![led_matrices_QAB_original_display_pins_top.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/312/medium640/led_matrices_QAB_original_display_pins_top.jpg?1663884545)

## HT16K33 Matrix Driver
The chip located in the center of the back of the backpack is the HT16K33 matrix driver, which drives the 14-segment LED displays.

![led_matrices_QAB_HT16K33.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/315/medium640/led_matrices_QAB_HT16K33.jpg?1663885964)

![led_matrices_QAB_original_HT16K33.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/316/medium640/led_matrices_QAB_original_HT16K33.jpg?1663885988)

## Address Jumper Pins
On the back of the board are **three address jumpers** , labeled **A0** , **A1** , and **A2**. These jumpers allow you to chain up to 8 of these boards on the same pair of I2C clock and data pins. To do so, you solder the jumpers "closed" in various combinations by connecting the two pads.

The default I2C address is **0x70**. The other address options can be calculated by “adding” the **A0/A1/A2** to the base of **0x70**.

![led_matrices_QAB_address_jumpers.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/317/medium640/led_matrices_QAB_address_jumpers.jpg?1663886388)

![led_matrices_QAB_original_address_jumpers.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/318/medium640/led_matrices_QAB_original_address_jumpers.jpg?1663886548)

 **A0** sets the lowest bit with a value of **1** , **A1** sets the next bit with a value of **2** and **A2** sets the next bit with a value of **4.** The final address is **0x7**** 0 + A2 + A1 + A0 **which would be** 0x77**.

So for example if **A2** is soldered closed and **A0** is soldered closed, the address is **0x70 + 4 + 1 = 0x75**.

 If only **A0** is soldered closed, the address is **0x70 + 1 = 0x71**

 If only **A1** is soldered closed, the address is **0x70 + 2 = 0x72**

 If only **A2** is soldered closed, the address is **0x70 + 4 = 0x74**

The table below shows all possible addresses, and whether the pin(s) should be high (closed) or low (open).

![](https://cdn-learn.adafruit.com/assets/assets/000/115/319/medium800/led_matrices_QAB_HT16K33_I2C_addresses.png?1663887143)

# Adafruit LED Backpacks

## Assembly

# Attaching the Backpack

The assembly photos below are the original version. Assembly is the same for both the original version and the STEMMA QT version.

Info: 

When you buy a pack from Adafruit, it comes with the fully tested and assembled backpack as well as two dual 14-segment display in one of the colors we provide (say, red, yellow, blue or green). You'll need to solder the matrix onto the backpack but it's an easy task.

![led_matrix_align.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/205/medium640/led_matrix_align.jpg?1402074180)

Remove the parts from packaging and place the LED matrices OVER the silkscreen side. **DO NOT PUT THE DISPLAY ON UPSIDE DOWN OR IT WONT WORK!! Check the image below to make sure the 'decimal point' dots are on the bottom, matching the silkscreen.**

![led_matrix_place.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/206/medium640/led_matrix_place.jpg?1402074210)

Turn the backpack over so it is sitting flat on the matrix.

![led_matrix_legs.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/207/medium640/led_matrix_legs.jpg?1402074236)

![led_matrix_flip.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/208/medium640/led_matrix_flip.jpg?1402074242)

Solder all of the pins!  
![led_matrix_solder1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/209/medium640/led_matrix_solder1.jpg?1402074253)

![led_matrix_solder2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/210/medium640/led_matrix_solder2.jpg?1402074258)

![led_matrix_solder3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/211/medium640/led_matrix_solder3.jpg?1402074262)

![led_matrix_solder4.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/212/medium640/led_matrix_solder4.jpg?1402074267)

Clip the long pins.![led_matrix_clip1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/213/medium640/led_matrix_clip1.jpg?1402074307)

![led_matrix_clip2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/214/medium640/led_matrix_clip2.jpg?1402074313)

![led_matrix_clip3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/215/medium640/led_matrix_clip3.jpg?1402074319)

Check your work, making sure each pin is nicely soldered, and there's no cold solder joints or shorted pins

![led_matrix_done.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/216/medium640/led_matrix_done.jpg?1402074341)

# Attaching Header
 
## Prepare the header strip:
Cut the strip to length if necessary. It will be easier to solder if you insert it into a breadboard - **long pins down** ![led_matrix_header.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/218/medium640/led_matrix_header.jpg?1402074544)

## Add the Backpack:
Place the backpack board over the pins so that the short pins poke through the breakout pads![led_matrix_place.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/219/medium640/led_matrix_place.jpg?1402074602)

Solder all 5 pins!

![led_matrix_solder1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/220/medium640/led_matrix_solder1.jpg?1402074614)

That's it! now you're ready to run the firmware on your Arduino!

# Adafruit LED Backpacks

## Arduino Wiring and Setup

# Downloading the Arduino Library

We wrote a basic library to help you work with the alphanumeric backpack. The library is written for the Arduino and will work with any Arduino as it just uses the I2C pins. The code is very portable and can be easily adapted to any I2C-capable micro.  
  
Begin by downloading our [Adafruit LED Backpack library](https://github.com/adafruit/Adafruit-LED-Backpack-Library "Link: https://github.com/adafruit/Adafruit-LED-Backpack-Library")and the [Adafruit GFX library](https://github.com/adafruit/Adafruit-GFX-Library) from the Arduino library manager.

Open up the Arduino library manager:

![](https://cdn-learn.adafruit.com/assets/assets/000/084/450/medium800/led_matrices_1library_manager_menu.png?1574045106)

Search for the&nbsp; **Adafruit LED Backpack&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/451/medium800/led_matrices_led_backpack.png?1574045191)

When asked to install dependencies, click **Install all.**

![](https://cdn-learn.adafruit.com/assets/assets/000/115/457/medium800/led_matrices_QAB_Adafruit_LED_Backpack_dependencies.png?1664387721)

We also have a great tutorial on Arduino library installation at:  
[http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use "Link: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use")

Primary: 

# Wiring STEMMA QT Version

Here is an example of the STEMMA QT version wired to a Metro using the STEMMA QT connector on the backpack.

- **Board 5V** &nbsp;to **backpack Vio (red wire)**
- **Board GND** &nbsp;to **backpack** **GND (black wire)**
- **Board SCL** &nbsp;to **backpack** **SCL (yellow wire)**
- **Board SDA** &nbsp;to **backpack** **SDA (blue wire)**

![led_matrices_QAB_Arduino_STEMMA_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/395/medium640/led_matrices_QAB_Arduino_STEMMA_bb.jpg?1664307667)

Here is an example of the STEMMA QT version wired to a Metro using a solderless breadboard. This example also includes how to wire up the VHi pin, which makes the LEDs appear brighter.

- **Board 5V** &nbsp;to **backpack Vio (long red wire)**
- **Board GND** &nbsp;to **backpack** **GND (black wire)**
- **Board SCL** &nbsp;to **backpack** **SCL (yellow wire)**
- **Board SDA** &nbsp;to **backpack** **SDA (blue wire)**
- **Backpack VIO** to **backpack VHi (short red wire)**

![led_matrices_QAB_Arduino_breadboard_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/397/medium640/led_matrices_QAB_Arduino_breadboard_bb.jpg?1664307846)

# Wiring Original Version
- Connect **CLK** to the I2C clock - on Arduino UNO thats Analog #5 (or SCL), on the Leonardo it's Digital #3, on the Mega it's digital #21
- Connect **DAT** to the I2C data - on Arduino UNO thats Analog #4 (or SDA), on the Leonardo it's Digital #2, on the Mega it's digital #20
- Connect **GND** to common ground
- Connect **VCC+** to power - 5V is best but 3V will work if that's all you've got (it will be dimmer)
- Connect **Vi2c** to your microcontroller's logic level (3-5V) - If you're using an Arduino, this is almost certainly 5V. If its a 3V Arduino such as a Due, connect it to 3V

Both **Vi2c** and **Vcc** MUST be connected to 3 to 5VDC! Vcc is for the LED driver power, Vi2c is what sets the logic level for communication to the chip.

![led_matrix_wiring.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/226/medium640/led_matrix_wiring.jpg?1402080363)

# Load Demo

Restart the Arduino IDE and load up the **File→Adafruit\_LEDBackpack→quadalphanum** demo

![](https://cdn-learn.adafruit.com/assets/assets/000/017/221/medium800/led_matrix_loaddemo.png?1402079321)

Upload to your Arduino, and open up the Serial console at 9600 baud speed. You'll see each digit light up all the segments, then the display will scroll through the 'font table' showing every character that it knows how to display. Finally, you'll get a notice to start typing into the serial console. Type a message and hit return, you'll see it scroll onto the display!

![](https://cdn-learn.adafruit.com/assets/assets/000/017/224/medium800/led_matrix_demo.png?1402079528)

![](https://cdn-learn.adafruit.com/assets/assets/000/017/223/medium800/led_matrix_1912-08.jpg?1402079512)

# Library Reference
For the quad displays, we have a special object that can handle ascii data for easy printing.  
  
You can create the object with  
```
Adafruit_AlphaNum4 alpha4 = Adafruit_AlphaNum4();
```

There's no arguments or pins because the backpacks use the fixed I2C pins.  
By default, the address is 0x70, but you can pass in the I2C address used when you initialize the display with **begin**

```
alpha4.begin(0x70);  // pass in the address
```

Next up, the segments can be turned on/off for each digit by writing the 'raw' bitmap you want, for example, all the LEDs off on digit #3 is

```
alpha4.writeDigitRaw(3, 0x0);
```

All the segments on for digit #0 is

```
alpha4.writeDigitRaw(0, 0x3FFF);
```

This is the segment map:

![](https://cdn-learn.adafruit.com/assets/assets/000/017/225/medium800/led_matrix_segments.png?1402079767)

the 16 bit digit you pass in for raw image has this mapping **:**

> 0 **DP N M L K J H G2 G1 F E D C B A**

The first bit isn't used, you can make it 0 or 1  
  
To turn on just the **A** segment, use 0x0001  
To turn on just the **G1** segment, use 0x0040

# ASCII data
If you're just looking to print 'text' you can use our font table, just pass in an ASCII character!  
  
For example, to set digit #0 to **A** call:  
```
alpha4.writeDigitAscii(0, 'A')
```

# Writing Data
Don't forget to 'write' the data to the display with  
```
alpha4.writeDisplay();
```

That's what actually 'sets' the data onto the LEDs!

![](https://cdn-learn.adafruit.com/assets/assets/000/084/452/medium800/led_matrices_gfx.png?1574045229)

# Adafruit LED Backpacks

## CircuitPython Wiring and Setup

It's easy to use LED AlphaNumeric Displays with CircuitPython and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This module allows you to easily write CircuitPython code to control the display.

You can use this backpack with any CircuitPython microcontroller board.

First [assemble your AlphaNumeric Display](https://learn.adafruit.com/adafruit-led-backpack/0-54-alphanumeric-assembly).

# Wiring STEMMA QT Version

Here is an example of the STEMMA QT version wired to a Feather RP2040 using the STEMMA QT connector on the backpack.

- **Board 3.3V** &nbsp;to **backpack Vio (red wire)**
- **Board GND** &nbsp;to **backpack** **GND (black wire)**
- **Board SCL** &nbsp;to **backpack** **SCL (yellow wire)**
- **Board SDA** &nbsp;to **backpack** **SDA (blue wire)**

![led_matrices_QAB_Feather_STEMMA_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/425/medium640/led_matrices_QAB_Feather_STEMMA_bb.jpg?1664311238)

Here is an example of the STEMMA QT version wired to a Feather RP2040 using a solderless breadboard. This example also includes how to wire up the VHi pin, which makes the LEDs appear brighter.

- **Board 5V** &nbsp;to **backpack Vio (red wire connected along the bottom of the Feather)**
- **Board GND** &nbsp;to **backpack** **GND (black wire)**
- **Board SCL** &nbsp;to **backpack** **SCL (yellow wire)**
- **Board SDA** &nbsp;to **backpack** **SDA (blue wire)**
- **Board USB** to **backpack VHi (red wire connected along the top of the Feather)**

![led_matrices_QAB_Feather_breadboard_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/426/medium640/led_matrices_QAB_Feather_breadboard_bb.jpg?1664311307)

# Wiring Original Version

Connect the AlphaNumeric Display to your microcontroller board as shown below.

- **Microcontroller 3V&nbsp;** to **AlphaNumeric Display I2C VIN**
- **Microcontroller 3V&nbsp;** to **AlphaNumeric Display&nbsp;VIN**
- **Microcontroller GND&nbsp;** to **AlphaNumeric Display&nbsp;GND**
- **Microcontroller SCL&nbsp;** to **AlphaNumeric Display&nbsp;SCL**
- **Microcontroller SDA&nbsp;** to **AlphaNumeric Display&nbsp;SDA**

![led_matrices_feather-m4-alphanum_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/087/740/medium640/led_matrices_feather-m4-alphanum_bb.jpg?1580229353)

# HT16K33 Library Installation

To use with CircuitPython, you need to first install the HT16K33 library, and its dependencies, into the&nbsp; **lib** &nbsp;folder on your&nbsp; **CIRCUITPY** &nbsp;drive. Then you need to update&nbsp; **code.py** &nbsp;with the example script.

Thankfully, you can do this in one go. In the example below, click the&nbsp; **Download Project Bundle** &nbsp;button below to download the necessary libraries and the&nbsp; **code.py** &nbsp;file in a zip file. Extract the contents of the zip file, and copy the&nbsp; **entire&nbsp;**** lib **&nbsp;** folder **&nbsp;** and the **&nbsp;** code.py **&nbsp;** file **to your&nbsp;** CIRCUITPY**&nbsp;drive.

Your&nbsp; **CIRCUITPY/lib** &nbsp;folder should contain the following folders:

- **adafruit\_bus\_device/**
- **adafruit\_ht16k33/**

https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/blob/main/examples/ht16k33_segments_14x4_demo.py

![CIRCUITPY](https://adafruit.github.io/Adafruit_CircuitPython_Bundle/ht16k33_ht16k33_segments_14x4_demo.py.png )

# Adafruit LED Backpacks

## Python Wiring and Setup

# Wiring

It's easy to use AlphaNumeric Displays with Python and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This library allows you to easily write Python code to control the display.

This section will cover how to wire the AlphaNumeric Display to your Raspberry Pi. First assemble your AlphaNumeric Display.

Since there's _dozens_ of Linux computers/boards you can use, this guide will just show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Connect the AlphaNumeric Display as shown below to your Raspberry Pi.

## Wiring STEMMA QT Version

Here is an example of wiring the STEMMA QT version of the backpack to a Raspberry Pi using the STEMMA QT connector.

- **Pi GND&nbsp;** to **backpack GND (black wire)**
- **Pi 3.3V&nbsp;** to **backpack VIO (red wire)**
- **Pi SDA&nbsp;** to **backpack SDA (blue wire)**  
- **Pi SCL&nbsp;** to **backpack SCL (yellow wire)**

![led_matrices_QAB_RasPi_STEMMA_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/455/medium640/led_matrices_QAB_RasPi_STEMMA_bb.jpg?1664385981)

Here is an example of wiring the STEMMA QT version of the backpack using a solderless breadboard. This example also includes how to wire up the VHi pin, which makes the LEDs appear brighter.

- **Pi GND&nbsp;** to **backpack GND (black wire)**
- **Pi 3.3V&nbsp;** to **backpack VIO (lower red wire)**
- **Pi SDA&nbsp;** to **backpack SDA (blue wire)**  
- **Pi SCL&nbsp;** to **backpack SCL (yellow wire)**
- **Pi 5V** to **backpack VHi (upper red wire)**  

![led_matrices_QAB_RasPi_breadboard_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/456/medium640/led_matrices_QAB_RasPi_breadboard_bb.jpg?1664386138)

## Wiring Original Version
- **Raspberry Pi 3.3V&nbsp;** to **AlphaNumeric Display I2C VIN**
- **Raspberry Pi 3.3V&nbsp;** to **AlphaNumeric Display&nbsp;VIN**
- **Raspberry Pi GND&nbsp;** to **AlphaNumeric Display&nbsp;GND**
- **Raspberry Pi SCL&nbsp;** to **AlphaNumeric Display&nbsp;SCL**
- **Raspberry Pi SDA&nbsp;** to **AlphaNumeric Display&nbsp;SDA**

![led_matrices_raspberry-pi-alphanum_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/087/520/medium640/led_matrices_raspberry-pi-alphanum_bb.jpg?1579914185)

# Setup

You'll need to install the Adafruit\_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

## Python Installation of HT16K33 Library

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-ht16k33`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

If that complains about pip3 not being installed, then run this first to install it:

- `sudo apt-get install python3-pip`

## Pillow Library

You also need PIL, the Python Imaging Library, to allow using text with custom fonts. There are several system libraries that PIL relies on, so installing via a package manager is the easiest way to bring in everything:

- `sudo apt-get install python3-pil`

That's it. You should be ready to go.

# Adafruit LED Backpacks

## CircuitPython and Python Usage

The following section will show how to control the LED backpack&nbsp;from the board's Python prompt / REPL. &nbsp;You'll walk through how to control the LED display and learn how to use the CircuitPython module built for the display.

First&nbsp;[connect to the board's serial REPL&nbsp;](https://learn.adafruit.com/welcome-to-circuitpython/the-repl)so you are at the CircuitPython&nbsp; **\>\>\>** &nbsp;prompt.

## Initialization

First you'll need to initialize the I2C bus for your board.&nbsp; It's really easy, first import the necessary modules. In this case, you'll use `board` and `Seg14x4`.

Then just use `board.I2C()` to create the I2C instance using the default SCL and SDA pins (which will be marked on the boards pins if using a Feather or similar Adafruit board).

Then to initialize the display, you just pass `i2c` in.

Warning: When using the STEMMA QT port, some board may have an alternate I2C such as board.STEMMA_I2C().

```python
import board
from adafruit_ht16k33.segments import Seg14x4

i2c = board.I2C()
display = Seg14x4(i2c)
```

If you bridged the address pads on the back of the display, you could pass in the address. The addresses for the HT16K33 can range between 0x70 and 0x77 depending on which pads you have bridged, with 0x70 being used if you haven't bridged any of them. For instance, if you bridge only the **A0** pad, you would use `0x71` like this:

```python
display = Seg14x4(i2c, address=0x71)
```

If you intend to chain multiple displays together, you will need to alter the address of subsequent boards by [bridging the address pins in various combinations](https://learn.adafruit.com/adafruit-led-backpack/pinouts#address-jumper-pins-3127675). If you have an unsoldered board, and a board with the A0 pad solder-bridged, you would initialize the two displays as follows.

```python
display = Seg14x4(i2c, address=(0x70, 0x71))
```

To add further displays, [ensure the address is different on all of them](https://learn.adafruit.com/adafruit-led-backpack/pinouts#address-jumper-pins-3127675), and initialize it the same way as above, but add more comma-separated addresses to the `address=()` tuple.

## Setting the Brightness

You can set the brightness of the display, but changing it will set the brightness of the entire display and not individual segments. It can be adjusted in 1/16 increments **between 0 and 1.0** with 1.0 being the brightest. So to set the display to half brightness, you would use the following:

```python
display.brightness = 0.5
```

## Setting the Blink Rate

You can also set the blink rate of the display. It can be adjusted in increments&nbsp; **between 0 and 3** , with 3 being the slowest blinking. So to set the display to blink at the slowest speed, you would use the following:

```python
display.blink_rate = 3
```

## Printing Text

To print text to the display, you just use the print function. So if you want to print ABCD, you would use the following:

```python
display.print("ABCD")
```

## Printing Numbers

Printing numbers is done similar to printing text, except without the quotes, though you can still print numbers in a string as well.

```python
display.print(1234)
```

## Printing Hexidecimal Values

To print hexidecimal values, you use the `print_hex` function:

```python
display.print_hex(0x1A2B)
```

## Setting Individual Characters

To set individual characters, you simply treat the `display` object as a list and set it to&nbsp;the value that you would like.

```python
display[0] = '1'
display[1] = '2'
display[2] = 'A'
display[3] = 'B'
```

## Setting Individual Segments

To set individual segments to turn on or off, you would use the set\_digit\_raw function to pass the digit that you want to change and the bitmask. This can be really useful for creating your own characters. The bitmask corresponds to the following diagram. The highest bit is not used, so an X represents that spot to indicate that.

![](https://cdn-learn.adafruit.com/assets/assets/000/088/406/medium800/led_matrices_set_pixel_raw.png?1581626233)

The bitmask is a 16-bit number that can be passed in as a single Hexidecimal, Decimal, or binary number. It can also be passed in as a list or tuple containing 2 separate 8-bit numbers. Here are some of the ways to set the digits. All of these different methods create a box with an X in the center:

```python
display.set_digit_raw(0, 0x2D3F)
display.set_digit_raw(1, 0b0010110100111111)
display.set_digit_raw(2, (0b00101101, 0b00111111))
display.set_digit_raw(3, [0x2D, 0x3F])
```

![](https://cdn-learn.adafruit.com/assets/assets/000/087/749/medium800/led_matrices_set_digit_raw_example.jpeg?1580236895)

## Filling all Segments

To fill the entire display, just use the fill() function and pass in either 0 or 1 depending on whether you want all segments off or on. For instance, if you wanted to set everything to on, you would use:

```python
display.fill(1)
```

## Scrolling Display Manually

If you want to scroll the displayed data to the left, you can use the `scroll()` function. You can pass in the number of places that you want to scroll. The right-most digit will remain unchanged and you will need to set that manually. After scrolling, you will need to call the show function. For example if you wanted to print an A and then scroll it over to spaces, you would do the following.

```python
display.print("A")
display.scroll(2)
display[3] = " "
display.show()
```

## Displaying an Automatic Scrolling Marquee

To make displaying long text easier, you can use the marquee function. You just pass it the full string. Optionally, you can pass it the amount of delay between each character:

```python
display.marquee("This is a really long string ")
```

![](https://cdn-learn.adafruit.com/assets/assets/000/087/748/medium800thumb/led_matrices_marquee.jpg?1580236874)

By default it is 0.25 seconds, but you can change this by providing a second parameter. You can optionally pass&nbsp;`False`&nbsp;for a third parameter if you would not like to have it loop. So if you wanted each character to display for half a second and didn't want it to loop, you would use the following:

```python
display.marquee('This is a really long string ', 0.5, False)
```

# Full Example

Click **Download Project Bundle** below to download a full example&nbsp; **code.py** and necessary libraries to run it.

https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/blob/main/examples/ht16k33_segments_14x4_demo.py

# Adafruit LED Backpacks

## 0.56" 7-Segment Backpack

This version of the LED backpack is designed for these big bright 7-segment displays. These 7-segment displays normally require 13 pins (5 'characters' and 8 total segments each) This backpack solves the annoyance of using 13 pins or a bunch of chips by having an I2C constant-current matrix controller sit neatly on the back of the PCB. The controller chip takes care of everything, drawing all the LEDs in the background. All you have to do is write data to it using the 2-pin I2C interface. There are three address select pins so you can select one of 8 addresses to control up to 8 of these on a single 2-pin I2C bus (as well as whatever other I2C chips or sensors you like). The driver chip can 'dim' the entire display from 1/16 brightness up to full brightness in 1/16th steps. It cannot dim individual LEDs, only the entire display at once.

To get you going fast, we have revised this popular board to be the same size and pinout as before but now with two [STEMMA QT connectors](https://learn.adafruit.com/introducing-adafruit-stemma-qt/what-is-stemma-qt)&nbsp;on either side that are compatible with the&nbsp;[SparkFun Qwiic](https://www.sparkfun.com/qwiic)&nbsp;I2C connectors. This allows you to make solderless connections between your development board and the HT16K33 or to chain it with a wide range of other sensors and accessories using a&nbsp;[**compatible cable**](https://www.adafruit.com/?q=stemma%20qt%20cable).

![](https://cdn-learn.adafruit.com/assets/assets/000/108/773/medium800/led_matrices_LEDBP_wired_up.jpg?1644269638)

![](https://cdn-learn.adafruit.com/assets/assets/000/087/297/medium800/led_matrices_880-00.jpg?1579654969)

# Adafruit LED Backpacks

## Assembly and Arduino Wiring

For the STEMMA QT version, you can solder the headers on, or you can simply use a STEMMA QT cable!

- **Backpack + (VCC)** to **microcontroller 5V** (if using a board with 5V logic, otherwise use 3V for boards with 3V logic) **(red wire)**
- **Backpack - (GND)** to **microcontroller GND (black wire)**
- **Backpack D (SDA)** to **microcontroller SDA (blue wire)**
- **Backpack C (SCL)** to **microcontroller SCL (yellow wire)**

![led_matrices_LEDBP056_Arduino_STEMMA_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/108/839/medium640/led_matrices_LEDBP056_Arduino_STEMMA_bb.jpg?1644429487)

![led_matrices_LEDBP056_Arduino_breadboard_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/108/840/medium640/led_matrices_LEDBP056_Arduino_breadboard_bb.jpg?1644429525)

To assemble the LED backpack, follow along below.

Info: 

When you buy a pack from Adafruit, it comes with the fully tested and assembled backpack as well as a 7-segment display in one of the colors we provide (say, red, yellow, blue or green). You'll need to solder the matrix onto the backpack but it's an easy task.

![led_matrix_7segparts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/149/medium640/led_matrix_7segparts.jpg?1396760793)

Remove the parts from packaging and place the LED matrix OVER the silkscreen side.&nbsp; **DO NOT PUT THE DISPLAY ON UPSIDE DOWN OR IT WONT WORK!! Check the image below to make sure the 'decimal point' dots are on the bottom, matching the silkscreen.** ![led_matrix_7segplacetop.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/150/medium640/led_matrix_7segplacetop.jpg?1396760798)

Turn the backpack over so it is sitting flat on the matrix.

![led_matrix_7segside.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/151/medium640/led_matrix_7segside.jpg?1396760809)

Solder all 14 pins.![led_matrix_7segsolder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/152/medium640/led_matrix_7segsolder.jpg?1396760814)

Clip the long pins.![led_matrix_7segclip.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/153/medium640/led_matrix_7segclip.jpg?1396760824)

![led_matrix_7segsoldered.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/154/medium640/led_matrix_7segsoldered.jpg?1396760829)

Now you're ready to wire it up to a microcontroller. We'll assume you want to use a 4pin header. You can also of course solder wires directly. Place a 4-pin piece of header with the LONG pins down into the breadboard.![led_matrix_place4pin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/155/medium640/led_matrix_place4pin.jpg?1396760834)

Place the soldered backpack on top of the header and Solder 'em!![led_matrix_7segheader.jpg](https://cdn-learn.adafruit.com/assets/assets/000/000/156/medium640/led_matrix_7segheader.jpg?1396760843)

That's it! now you're ready to run the firmware!# Adafruit LED Backpacks

## Arduino Setup

Primary: 

## Seven-Segment Backpack Firmware

We wrote a basic library to help you work with the 7-segment backpack. The library is written for the Arduino and will work with any Arduino as it just uses the I2C pins. The code is very portable and can be easily adapted to any I2C-capable micro.

Wiring to the matrix is really easy

- Connect **CLK** to the I2C clock - on Arduino UNO thats Analog #5 (or SCL), on the Leonardo it's Digital #3, on the Mega it's digital #21
- Connect **DAT** to the I2C data - on Arduino UNO thats Analog #4 (or SDA), on the Leonardo it's Digital #2, on the Mega it's digital #20
- Connect **GND** to common ground
- Connect **VCC+** to power - 5V is best but 3V also seems to work for 3V microcontrollers.

If using the STEMMA QT version of the backpack, simply plug in the STEMMA QT connectors between boards.

Next, download the&nbsp; **Adafruit LED Backpack&nbsp;** library and the&nbsp; **Adafruit GFX&nbsp;** library from the Arduino library manager.

Open up the Arduino library manager:

![](https://cdn-learn.adafruit.com/assets/assets/000/084/468/medium800/led_matrices_1library_manager_menu.png?1574047617)

Search for the&nbsp; **Adafruit LED Backpack&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/469/medium800/led_matrices_led_backpack.png?1574047637)

Search for the&nbsp; **Adafruit GFX&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/470/medium800/led_matrices_gfx.png?1574047649)

If using an earlier version of the Arduino IDE (prior to 1.8.10), also locate and install **Adafruit\_BusIO** (newer versions will install this dependency automatically).

Once you've restarted you should be able to select the **File→Examples→Adafruit\_LEDBackpack→sevenseg** example sketch. Upload it to your Arduino as usual. You should see a basic test program that goes through a bunch of different routines.

We also have a great tutorial on Arduino library installation at:  
[http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use "Link: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use")

![](https://cdn-learn.adafruit.com/assets/assets/000/000/157/medium800/led_matrix_red7segbackpack.jpg?1396760849)

Warning: 

Once you're happy that the matrix works, you can write your own sketches.

There's a few ways you can draw to the display. The easiest is to just call **print -** just like you do with **Serial**

- **print(_variable_**_,_**HEX) -** this will print a hexidecimal number, from 0000 up to FFFF
- **print(_variable_**_,_**DEC)** or **print(_variable_) -** this will print a decimal integer, from 0000 up to 9999

If you need more control, you can call **writeDigitNum(_location_, _number_)** - this will write the _number_ (0-9) to a single location. Location #0 is all the way to the left, location #2 is the colon dots so you probably want to skip it, location #4 is all the way to the right. If you want a decimal point, call **writeDigitNum(_location_, _number_, true)** which will paint the decimal point. To draw the colon, use**drawColon(_true_** _or_ **_false_)**

If you want&nbsp;even more control, you can call **writeDigitRaw(_location_,_bitmask_)** to draw a raw 8-bit mask (as stored in a uint8\_t) to that location.

All the drawing routines only change the display memory kept by the Arduino. Don't forget to call **writeDisplay()** after drawing to 'save' the memory out to the matrix via I2C.

There are also a few small routines that are special to the backpack:

- **setBrightness(_brightness_)**- will let you change the overall brightness of the entire display. 0 is least bright, 15 is brightest and is what is initialized by the display when you start
- **blinkRate(_rate_)** - You can blink the entire display. 0 is no blinking. 1, 2 or 3 is for display blinking.

# Adafruit LED Backpacks

## CircuitPython Wiring and Setup

# Wiring

It's easy to use LED 7-Segment Displays with CircuitPython and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This module allows you to easily write CircuitPython code to control the display.

You can use this sensor with any CircuitPython microcontroller board.

We'll cover how to wire the 7-Segment Display to your CircuitPython microcontroller board. First assemble your 7-Segment Display.

Connect the 7-Segment Display to your microcontroller board as shown below.

- **Microcontroller 3V&nbsp;** to **7-Segment Display VIN (red wire)**  
- **Microcontroller GND&nbsp;** to **7-Segment Display GND (black wire)**  
- **Microcontroller SCL&nbsp;** to **7-Segment Display SCL (yellow wire)**  
- **Microcontroller SDA&nbsp;** to **7-Segment Display SDA (blue wire)**  

![led_matrices_LEDBP056_Feather_STEMMA_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/108/784/medium640/led_matrices_LEDBP056_Feather_STEMMA_bb.jpg?1644272303)

![led_matrices_LEDBP056_Feather_breadboard_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/108/785/medium640/led_matrices_LEDBP056_Feather_breadboard_bb.jpg?1644272323)

![led_matrices_LEDBP056_Original_Feather.jpg](https://cdn-learn.adafruit.com/assets/assets/000/108/786/medium640/led_matrices_LEDBP056_Original_Feather.jpg?1644272329)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/087/713/original/feather-m4-7-segment.fzz?1580170381)
# Library Setup

To use the LED backpack&nbsp;with your&nbsp;[Adafruit CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/overview)&nbsp;board you'll need to install the&nbsp;[Adafruit\_CircuitPython\_HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library on your board.

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://github.com/adafruit/circuitpython/releases)&nbsp;for your board. &nbsp;Next you'll need to install the necessary libraries&nbsp;to use the hardware--read below and carefully follow the referenced steps to find and install these libraries from [Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).

## Bundle Install

For express boards that have extra flash storage, like the Feather/Metro M0 express and Circuit Playground express, you can easily install the necessary libraries with [Adafruit's CircuitPython bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle). &nbsp;This is an all-in-one package that includes the necessary libraries to use the LED backpack display with CircuitPython. For details on installing the bundle, read about [CircuitPython Libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

Remember for non-express boards like the Trinket M0, Gemma M0, and Feather/Metro M0 basic you'll need to [manually install the necessary libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries#non-express-boards-11-13) from the bundle:

- **adafruit\_ht16k33**
- **adafruit\_bus\_device**

If your board supports USB mass storage, like the M0-based boards, then simply drag the files to the board's file system.&nbsp;**Note on boards without external SPI flash, like a Feather M0 or Trinket/Gemma M0, you might run into issues on Mac OSX with hidden files taking up too much space when drag and drop copying,&nbsp;[see this page for a workaround](../../../../micropython-for-samd21/usb-mass-storage#mac-osx-file-copy-issues).**

Before continuing make sure your board's **lib** folder or root filesystem has at least the&nbsp; **adafruit\_ht16k33** and&nbsp; **adafruit\_bus\_device** &nbsp;folders/modules copied over.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/098/medium800/led_matrices_circuitpy.png?1579297124)

# Adafruit LED Backpacks

## Python Wiring and Setup

# Wiring

It's easy to use 7-Segment Displays with Python and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This library allows you to easily write Python code to control the display.

We'll cover how to wire the 7-Segment Display to your Raspberry Pi. First assemble your 7-Segment Display.

Since there's _dozens_ of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Connect the 7-Segment Display as shown below to your Raspberry Pi.

- **Raspberry Pi 3.3V&nbsp;** to **7-Segment Display VIN (red wire)**  
- **Raspberry Pi GND&nbsp;** to **7-Segment Display GND (black wire)**  
- **Raspberry Pi SCL&nbsp;** to **7-Segment Display SCL (yellow wire)**  
- **Raspberry Pi SDA&nbsp;** to **7-Segment Display SDA (blue wire)**  

![led_matrices_LEDBP056_RasPi_STEMMA_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/108/787/medium640/led_matrices_LEDBP056_RasPi_STEMMA_bb.jpg?1644272369)

![led_matrices_LEDBP056_RasPi_breadboard_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/108/788/medium640/led_matrices_LEDBP056_RasPi_breadboard_bb.jpg?1644272388)

![led_matrices_LEDBP056_Original_RasPi.jpg](https://cdn-learn.adafruit.com/assets/assets/000/108/789/medium640/led_matrices_LEDBP056_Original_RasPi.jpg?1644272394)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/087/712/original/raspberry-pi-7-segment.fzz?1580170350)
# Setup

You'll need to install the Adafruit\_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

## Python Installation of HT16K33 Library

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-ht16k33`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

If that complains about pip3 not being installed, then run this first to install it:

- `sudo apt-get install python3-pip`

## Pillow Library

We also need PIL, the Python Imaging Library, to allow using text with custom fonts. There are several system libraries that PIL relies on, so installing via a package manager is the easiest way to bring in everything:

- `sudo apt-get install python3-pil`

That's it. You should be ready to go.

# Adafruit LED Backpacks

## CircuitPython and Python Usage

The following section will show how to control the LED backpack&nbsp;from the board's Python prompt / REPL. &nbsp;You'll walk through how to control the LED display and learn how to use the CircuitPython module built for the display.

First&nbsp;[connect to the board's serial REPL&nbsp;](https://learn.adafruit.com/welcome-to-circuitpython/the-repl)so you are at the CircuitPython&nbsp; **\>\>\>** &nbsp;prompt.

## Initialization

First you'll need to initialize the I2C bus for your board.&nbsp; It's really easy, first import the necessary modules. In this case, we'll use `board` and `Seg7x4`.

Then just use `board.I2C()` to create the I2C instance using the default SCL and SDA pins (which will be marked on the boards pins if using a Feather or similar Adafruit board).

Then to initialize the display, you just pass `i2c` in.

Warning: When using the STEMMA QT port, some board may have an alternate I2C such as board.STEMMA_I2C().

```python
import board
from adafruit_ht16k33.segments import Seg7x4

i2c = board.I2C()
display = Seg7x4(i2c)
```

If you bridged the address pads on the back of the display, you could pass in the address. The addresses for the HT16K33 can range between 0x70 and 0x77 depending on which pads you have bridged, with 0x70 being used if you haven't bridged any of them. For instance, if you bridge only the **A0** pad, you would use `0x71` like this:

```python
display = Seg7x4(i2c, address=0x71)
```

If you intend to chain multiple displays together, you will need to alter the address of subsequent boards by [bridging the address pins in various combinations](https://learn.adafruit.com/adafruit-led-backpack/pinouts#address-jumper-pins-3127675). If you have an unsoldered board, and a board with the A0 pad solder-bridged, you would initialisz the two displays as follows.

```python
display = Seg14x4(i2c, address=(0x70, 0x71))
```

To add further displays, [ensure the address is different on all of them](https://learn.adafruit.com/adafruit-led-backpack/pinouts#address-jumper-pins-3127675), and initialize it the same way as above, but add more comma-separated addresses to the `address=()` tuple.

## Setting the Brightness

You can set the brightness of the display, but changing it will set the brightness of the entire display and not individual segments. If can be adjusted in 1/16 increments **between 0 and 1.0** with 1.0 being the brightest. So to set the display to half brightness, you would use the following:

```python
display.brightness = 0.5
```

## Setting the Blink Rate

You can also set the blink rate of the display. It can be adjusted in increments&nbsp; **between 0 and 3** , with 3 being the slowest blinking. So to set the display to blink at the slowest speed, you would use the following:

```python
display.blink_rate = 3
```

## Printing Text

To print text to the display, you just use the print function. For the 7-segment display, valid characters are 0-9, letters A-F, a period, a hyphen, and a space. So if we want to print ABCD, we would use the following:

```python
display.print("ABCD")
```

## Printing Numbers

Printing numbers is done similar to printing text, except without the quotes, though you can still print numbers in a string as well.

```python
display.print(1234)
```

## Printing Hexadecimal Values

To print hexadecimal values, you use the `print_hex` function:

```python
display.print_hex(0x1A2B)
```

## Setting Individual Characters

To set individual characters, you simply treat the `display` object as a list and set it to&nbsp;the value that you would like.

```python
display[0] = '1'
display[1] = '2'
display[2] = 'A'
display[3] = 'B'
```

## Setting Individual Segments

To set individual segments to turn on or off, you would use the set\_digit\_raw function to pass the digit that you want to change and the bitmask. This can be really useful for creating your own characters. The bitmask corresponds to the following diagram:

![](https://cdn-learn.adafruit.com/assets/assets/000/088/407/medium800/led_matrices_set_pixel_raw.png?1581626254)

The bitmask is a single 8-bit number that can be passed in as a single Hexadecimal, Decimal, or binary number. This will use a couple different methods to display `8.8.EE`:

```python
display.set_digit_raw(0, 0xFF)
display.set_digit_raw(1, 0b11111111)
display.set_digit_raw(2, 0x79)
display.set_digit_raw(3, 0b01111001)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/087/747/medium800/led_matrices_set_digit_raw_example.jpeg?1580236725)

## Filling all Segments

To fill the entire display, just use the fill() function and pass in either 0 or 1 depending on whether you want all segments off or on. For instance, if you wanted to set everything to on, you would use:

```python
display.fill(1)
```

## Scrolling Display Manually

If you want to scroll the displayed data to the left, you can use the `scroll()` function. You can pass in the number of places that you want to scroll. The right-most digit will remain unchanged and you will need to set that manually. After scrolling, you will need to call the show function. For example if you wanted to print an A and then scroll it over to spaces, you would do the following.

```python
display.print("A")
display.scroll(2)
display[3] = " "
display.show()
```

## Displaying the Colon

There are a couple of different ways to display a colon on the 7-segment display. The first and easiest way is to use the print function:

```python
display.print("12:30")
```

The other way to control it is to access the colon with the colon property and set it to `True` or `False`:

```python
display.colon = False
```

## Displaying an Automatic Scrolling Marquee

To make displaying long text easier, we've added a marquee function. You just pass it the full string. Optionally, you can pass it the amount of delay between each character. This may be useful for displaying an IP address, a phone number, or other numeric data:

```python
display.marquee('192.168.100.102... ')
```

![](https://cdn-learn.adafruit.com/assets/assets/000/087/746/medium800thumb/led_matrices_marquee.jpg?1580236698)

By default it is 0.25 seconds, but you can change this by providing a second parameter. You can optionally pass `False` for a third parameter if you would not like to have it loop. So if you wanted each character to display for half a second and didn't want it to loop, you would use the following:

```python
display.marquee('192.168.100.102... ', 0.5, False)
```

# Adafruit LED Backpacks

## 1.2" 7-segment Backpack

These backpacks drive the massive 1.2" 7-segment modules. With 2 leds per segment these make a gorgeous and impressive display. The 7-segment displays normally require 16 pins to drive. This backpack uses an I2C constant-current matrix controller on the back of the PCB, so you only need 2 pins to drive it!  
  
The controller chip takes care of multiplexing all the LEDs in the background. All you have to do is write data to it using the 2-pin I2C interface. There are three address select pins so you can select one of 8 addresses to control up to 8 of these on a single 2-pin I2C bus (as well as whatever other I2C chips or sensors you like). The driver chip can 'dim' the entire display from 1/16 brightness up to full brightness in 1/16th steps. It cannot dim individual LEDs, only the entire display at once.

**New! As of June 13, 2023** &nbsp;we have updated the backpack board to have a 5V boost converter which means you can use it with 3.3V power and get nice bright LED segments without having to wire up a separate 5V power supply. It also has Stemma QT ports for plug-n-play connectivity

![](https://cdn-learn.adafruit.com/assets/assets/000/087/300/medium800/led_matrices_1270-03.jpg?1579655729)

# Adafruit LED Backpacks

## Assembly

When you buy a pack from Adafruit, it comes with the fully tested and assembled backpack as well as a 7-segment display in one of the colors we provide (say, red, yellow, blue or green). You'll need to solder the matrix onto the backpack but its an easy task.

![led_matrix_2013_04_12_IMG_1603-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/004/537/medium640/led_matrix_2013_04_12_IMG_1603-1024.jpg?1396814068)

Remove the parts from packaging and place the LED matrix OVER the silkscreen side. **DO NOT PUT THE DISPLAY ON UPSIDE DOWN OR IT WONT WORK!! Check the image below to make sure the 'decimal point' dots are in the same location as the ones on the silkscreen.**

![led_matrix_2013_04_12_IMG_1606-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/007/376/medium640/led_matrix_2013_04_12_IMG_1606-1024.jpg?1396850621)

Turn the backpack over so its sitting flat on the matrix and ready to solder.

![led_matrix_2013_04_12_IMG_1609-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/007/377/medium640/led_matrix_2013_04_12_IMG_1609-1024.jpg?1396850633)

Then solder each pin. There are 8 on each end for a total of 16.

![led_matrix_2013_04_12_IMG_1610-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/007/381/medium640/led_matrix_2013_04_12_IMG_1610-1024.jpg?1396850680)

![led_matrix_2013_04_12_IMG_1624-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/007/382/medium640/led_matrix_2013_04_12_IMG_1624-1024.jpg?1396850691)

That completes the basic assembly. For use on a breadboard, you will want to also install a 5-pin header on the edge of the board.

Clip the long pins close to the board.

![led_matrix_2013_04_12_IMG_1628-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/007/383/medium640/led_matrix_2013_04_12_IMG_1628-1024.jpg?1396850703)

Cut the header strip to length if necessary and insert LONG pins down into the breadboard.

![led_matrix_2013_04_12_IMG_1617-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/007/385/medium640/led_matrix_2013_04_12_IMG_1617-1024.jpg?1396850727)

![led_matrix_2013_04_12_IMG_1612-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/007/386/medium640/led_matrix_2013_04_12_IMG_1612-1024.jpg?1396850716)

Then solder all 5 pins.

![led_matrix_2013_04_12_IMG_1618-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/007/387/medium640/led_matrix_2013_04_12_IMG_1618-1024.jpg?1396850739)

![led_matrix_2013_04_12_IMG_1632-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/007/388/medium640/led_matrix_2013_04_12_IMG_1632-1024.jpg?1396850751)

# Adafruit LED Backpacks

## Arduino Wiring and Setup

Primary: 

Now you are ready to wire it to your microcontroller. The required connections are:

- **"D"** - I2C Data Pin (SDA)  
- **"C"** - I2C Clock Pin (SCL)  
- **"+"** - 5v. (Will not run on 3.3v!)  
- **"-"** - GND  
- **"IO"** - I2C bus voltage.   

Due to the size of this display, there are 2 LEDs in series for each segment. Because of this, the display requires 5v to run. It will not run on 3.3v.  
  
For use with 3.3v processors, connect the IO pin to 3.3v. This will keep the I2C bus signals at a safe level for your processor.   
  
With 5v processors like the Arduino UNO, this pin can be connected to either 5v or 3.3v. (use 3.3v if there will be other 3.3v devices on the bus) ## Arduino Wiring - R3 and later

**Connect:**

- D **→** SDA
- C **→** SCL
- + **→** 5v
- - **→** GND
- IO **→** jumper to + for 5v.

![led_matrix_2013_04_12_IMG_1639-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/007/391/medium640/led_matrix_2013_04_12_IMG_1639-1024.jpg?1396850786)

## Arduino Due and Other 3.3v Processors

**Connect:**

- D **→** SDA
- C **→** SCL
- + **→** 5v
- - **→** GND
- IO **→** 3.3v

![led_matrix_2013_04_12_IMG_1642-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/007/392/medium640/led_matrix_2013_04_12_IMG_1642-1024.jpg?1396850798)

## Arduino "Classic" Wiring

**Connect:**

- D **→** Analog-4 or Digital 20 for the Mega
- C **→** Analog-5 or Digital 21 for the Mega
- + **→** 5v
- - **→** GND
- IO **→** jumper to + for 5v.

![led_matrix_2013_04_12_IMG_1634-1024.jpg](https://cdn-learn.adafruit.com/assets/assets/000/007/393/medium640/led_matrix_2013_04_12_IMG_1634-1024.jpg?1396850810)

OK, now on to the firmware!

## Seven-Segment Backpack Firmware

Our 7-segment backpack library makes it easy to program these displays. The library is written for the Arduino and will work with any Arduino as it just uses the I2C pins. The code is very portable and can be easily adapted to any I2C-capable micro.

Download the **Adafruit LED Backpack&nbsp;** library and the&nbsp; **Adafruit GFX&nbsp;** library from the Arduino library manager.

Open up the Arduino library manager:

![](https://cdn-learn.adafruit.com/assets/assets/000/084/474/medium800/led_matrices_1library_manager_menu.png?1574047883)

Search for the&nbsp; **Adafruit LED Backpack&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/475/medium800/led_matrices_led_backpack.png?1574047919)

Search for the&nbsp; **Adafruit GFX&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/476/medium800/led_matrices_gfx.png?1574048036)

If using an earlier version of the Arduino IDE (prior to 1.8.10), also locate and install **Adafruit\_BusIO** (newer versions will install this dependency automatically).

We also have a great tutorial on Arduino library installation at:  
[http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use "Link: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use")

You should now be able to select the **File→Examples→Adafruit\_LEDBackpack→sevenseg** example sketch. Upload it to your Arduino as usual. You should see a "sevenseg" example sketch that will demonstrate various capabilities of the library and the display.

![](https://cdn-learn.adafruit.com/assets/assets/000/007/398/medium800/led_matrix_2013_04_12_IMG_1645-1024.jpg?1396850954)

Once you're happy that the matrix works, you can write your own sketches.

There's a few ways you can draw to the display. The easiest is to just call **print -** just like you do with **Serial**

- **print(_variable_**_,_**HEX) -** this will print a hexadecimal number, from 0000 up to FFFF
- **print(_variable_**_,_**DEC)** or **print(_variable_) -** this will print a decimal integer, from 0000 up to 9999

If you need more control, you can call **writeDigitNum(_location_, _number_)** - this will write the _number_ (0-9) to a single location. Location #0 is all the way to the left, location #2 is the colon dots so you probably want to skip it, location #4 is all the way to the right.

To control the colon and decimal points, use the writeDigitRaw(location, bitmap) function. &nbsp;(Note that both dots of the center colon are wired together internal to the display, so it is not possible to address them separately.) &nbsp;Specify 2 for the location and the bits are mapped as follows:

- 0x02 - center colon (both dots)
- 0x04 - left colon - lower dot
- 0x08 - left colon - upper dot
- 0x10 - decimal point (upper right)

If you want a decimal point, call **writeDigitNum(_location_, _number_, true)** which will paint the decimal point. To draw the colon, use **drawColon(_true_** _or_ **_false_)**

If you want full control of the segments in all digits, you can call **writeDigitRaw(_location_, _bitmask_)** to draw a raw 8-bit mask (as stored in a uint8\_t) to any location.

All the drawing routines only change the display memory kept by the Arduino. Don't forget to call **writeDisplay()** after drawing to 'save' the memory out to the matrix via I2C.

There are also a few small routines that are special to the backpack:

- **setBrightness(_brightness_)**- will let you change the overall brightness of the entire display. 0 is least bright, 15 is brightest and is what is initialized by the display when you start
- **blinkRate(_rate_)** - You can blink the entire display. 0 is no blinking. 1, 2 or 3 is for display blinking.

# Adafruit LED Backpacks

## CircuitPython Wiring and Setup

# Wiring

It's easy to use LED 7-Segment Displays with CircuitPython and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This module allows you to easily write CircuitPython code to control the display.

You can use this sensor with any CircuitPython microcontroller board.

We'll cover how to wire the 7-Segment Display to your CircuitPython microcontroller board. First assemble your 7-Segment Display.

Connect the 7-Segment Display to your microcontroller board as shown below.

Danger: 

Warning: 

![](https://cdn-learn.adafruit.com/assets/assets/000/111/870/medium800/led_matrices_metro-m4-big-7-segment_bb.jpg?1653062791)

- **Microcontroller 3.3V&nbsp;** to **3.3v Bus**
- **3.3v Bus** to **7-Segment Display IO**
- **Microcontroller 5V&nbsp;** to **7-Segment Display&nbsp;VIN**
- **Microcontroller GND&nbsp;** to **7-Segment Display&nbsp;GND**
- **Microcontroller SCL&nbsp;** to **7-Segment Display&nbsp;SCL**
- **Microcontroller SDA&nbsp;** to **7-Segment Display&nbsp;SDA**
- **1K Resistor** between **3.3v Bus** and **7-Segment Display&nbsp;SCL**
- **1K Resistor** between **3.3v Bus** and **7-Segment Display SDA**

You can also use a STEMMA QT cable to connect any board with a STEMMA QT port to the updated display.

![](https://cdn-learn.adafruit.com/assets/assets/000/122/072/medium800/led_matrices_feather-rp2040-big-7-segment-stemma_bb.jpg?1687557296)

# Library Setup

To use the LED backpack&nbsp;with your&nbsp;[Adafruit CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/overview)&nbsp;board you'll need to install the&nbsp;[Adafruit\_CircuitPython\_HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library on your board.

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://github.com/adafruit/circuitpython/releases)&nbsp;for your board. &nbsp;Next you'll need to install the necessary libraries&nbsp;to use the hardware--read below and carefully follow the referenced steps to find and install these libraries from [Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).

## Bundle Install

For express boards that have extra flash storage, like the Feather/Metro M0 express and Circuit Playground express, you can easily install the necessary libraries with [Adafruit's CircuitPython bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle). &nbsp;This is an all-in-one package that includes the necessary libraries to use the LED backpack display with CircuitPython. For details on installing the bundle, read about [CircuitPython Libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

Remember for non-express boards like the Trinket M0, Gemma M0, and Feather/Metro M0 basic you'll need to [manually install the necessary libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries#non-express-boards-11-13) from the bundle:

- **adafruit\_ht16k33**
- **adafruit\_bus\_device**

If your board supports USB mass storage, like the M0-based boards, then simply drag the files to the board's file system.&nbsp;**Note on boards without external SPI flash, like a Feather M0 or Trinket/Gemma M0, you might run into issues on Mac OSX with hidden files taking up too much space when drag and drop copying,&nbsp;[see this page for a workaround](../../../../micropython-for-samd21/usb-mass-storage#mac-osx-file-copy-issues).**

Before continuing make sure your board's **lib** folder or root filesystem has at least the&nbsp; **adafruit\_ht16k33** and&nbsp; **adafruit\_bus\_device** &nbsp;folders/modules copied over.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/098/medium800/led_matrices_circuitpy.png?1579297124)

# Adafruit LED Backpacks

## Python Wiring and Setup

# Wiring

It's easy to use 7-Segment Displays with Python and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This library allows you to easily write Python code to control the display.

We'll cover how to wire the 7-Segment Display to your Raspberry Pi. First assemble your 7-Segment Display.

Since there's _dozens_ of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Using wires, connect the 7-Segment Display as shown below to your Raspberry Pi.

- **Raspberry Pi 3.3V&nbsp;** to **7-Segment Display IO**
- **Raspberry Pi 5V&nbsp;** to **7-Segment Display&nbsp;VIN**
- **Raspberry Pi GND&nbsp;** to **7-Segment Display&nbsp;GND**
- **Raspberry Pi SCL&nbsp;** to **7-Segment Display&nbsp;SCL**
- **Raspberry Pi SDA&nbsp;** to **7-Segment Display&nbsp;SDA**

![led_matrices_raspberry-pi-big-7-segment_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/087/743/medium640/led_matrices_raspberry-pi-big-7-segment_bb.jpg?1580233158)

To wire up the display using the STEMMA QT port, if you have a board with STEMMA QT connected to the 40-pin header, you can just use a STEMMA QT cable. If you want to connect the display directly to the header pins, you can just use a cable such as:

### STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets

[STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets](https://www.adafruit.com/product/4397)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium female headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and...

In Stock
[Buy Now](https://www.adafruit.com/product/4397)
[Related Guides to the Product](https://learn.adafruit.com/products/4397/guides)
![Angled shot of JST SH 4-pin Cable with Premium Female Sockets.](https://cdn-shop.adafruit.com/640x480/4397-02.jpg)

Then connect the 7-Segment Display as shown below to your Raspberry Pi:

- **Raspberry Pi 3.3V&nbsp;** to STEMMA QT **red wire**
- **Raspberry Pi GND&nbsp;** to STEMMA QT **black wire**
- **Raspberry Pi SCL&nbsp;** to STEMMA QT **yellow wire**
- **Raspberry Pi SDA&nbsp;** to STEMMA QT **blue wire**

![led_matrices_raspberry-pi-big-7-segment-stemma_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/122/071/medium640/led_matrices_raspberry-pi-big-7-segment-stemma_bb.jpg?1687542740)

# Setup

You'll need to install the Adafruit\_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

## Python Installation of HT16K33 Library

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-ht16k33`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

If that complains about pip3 not being installed, then run this first to install it:

- `sudo apt-get install python3-pip`

## Pillow Library

If you are using one of the matrix displays, you also need PIL, the Python Imaging Library, to allow using text with custom fonts. There are several system libraries that PIL relies on, so installing via a package manager is the easiest way to bring in everything:

- `sudo apt-get install python3-pil`

That's it. You should be ready to go.

# Adafruit LED Backpacks

## CircuitPython and Python Usage

The following section will show how to control the LED backpack&nbsp;from the board's Python prompt / REPL. &nbsp;You'll walk through how to control the LED display and learn how to use the CircuitPython module built for the display.

First&nbsp;[connect to the board's serial REPL&nbsp;](https://learn.adafruit.com/welcome-to-circuitpython/the-repl)so you are at the CircuitPython&nbsp; **\>\>\>** &nbsp;prompt.

## Initialization

First you'll need to initialize the I2C bus for your board.&nbsp; It's really easy, first import the necessary modules. In this case, we'll use `board` and `BigSeg7x4`.

Then just use `board.I2C()` to create the I2C instance using the default SCL and SDA pins (which will be marked on the boards pins if using a Feather or similar Adafruit board).

Then to initialize the display, you just pass `i2c` in.

Warning: When using the STEMMA QT port, some board may have an alternate I2C such as board.STEMMA_I2C().

```python
import board
from adafruit_ht16k33.segments import BigSeg7x4

i2c = board.I2C()
display = BigSeg7x4(i2c)
```

If you bridged the address pads on the back of the display, you could pass in the address. The addresses for the HT16K33 can range between 0x70 and 0x77 depending on which pads you have bridged, with 0x70 being used if you haven't bridged any of them. For instance, if you bridge only the **A0** pad, you would use `0x71` like this:

```python
display = BigSeg7x4(i2c, address=0x71)
```

## Setting the Brightness

You can set the brightness of the display, but changing it will set the brightness of the entire display and not individual segments. If can be adjusted in 1/16 increments **between 0 and 1.0** with 1.0 being the brightest. So to set the display to half brightness, you would use the following:

```python
display.brightness = 0.5
```

## Setting the Blink Rate

You can also set the blink rate of the display. It can be adjusted in increments&nbsp; **between 0 and 3** , with 3 being the slowest blinking. So to set the display to blink at the slowest speed, you would use the following:

```python
display.blink_rate = 3
```

## Printing Text

To print text to the display, you just use the print function. For the 7-segment display, valid characters are 0-9, letters A-F, and a hyphen. So if we want to print ABCD, we would use the following:

```python
display.print("ABCD")
```

## Printing Numbers

Printing numbers is done similar to printing text, except without the quotes, though you can still print numbers in a string as well.

```python
display.print(1234)
```

## Printing Hexidecimal Values

To print hexidecimal values, you use the `print_hex` function:

```python
display.print_hex(0x1A2B)
```

## Setting Individual Characters

To set individual characters, you simply treat the `display` object as a list and set it to&nbsp;the value that you would like.

```python
display[0] = '1'
display[1] = '2'
display[2] = 'A'
display[3] = 'B'
```

## Setting Individual Segments

To set individual segments to turn on or off, you would use the set\_digit\_raw function to pass the digit that you want to change and the bitmask. This can be really useful for creating your own characters. The bitmask corresponds to the following diagram. The highest bit is not used, so an X represents that spot to indicate that.

![](https://cdn-learn.adafruit.com/assets/assets/000/088/408/medium800/led_matrices_set_pixel_raw.png?1581626276)

The bitmask is a single 8-bit number that can be passed in as a single Hexidecimal, Decimal, or binary number. This will use a couple different methods to display `8E8E`:

```python
display.set_digit_raw(0, 0xFF)
display.set_digit_raw(1, 0b11111111)
display.set_digit_raw(2, 0x79)
display.set_digit_raw(3, 0b01111001)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/087/750/medium800/led_matrices_set_digit_raw_example.jpeg?1580237134)

## Filling all Segments

To fill the entire display, just use the fill() function and pass in either 0 or 1 depending on whether you want all segments off or on. For instance, if you wanted to set everything to on, you would use:

```python
display.fill(1)
```

## Scrolling Display Manually

If you want to scroll the displayed data to the left, you can use the `scroll()` function. You can pass in the number of places that you want to scroll. The right-most digit will remain unchanged and you will need to set that manually. After scrolling, you will need to call the show function. For example if you wanted to print an A and then scroll it over to spaces, you would do the following.

```python
display.print("A")
display.scroll(2)
display[3] = " "
display.show()
```

## Displaying the Colon

There are a couple of different ways to display a colon on the 7-segment display. The first and easiest way is to use the print function:

```python
display.print("12:30")
```

The other way to control it is to access the colon with the colons property and set index 0 to `True` or `False`:

```python
display.colons[0] = False
```

## Setting the Left-Side Dots

There are a couple of different ways to set the left-side dots on the large 7-segment display. The first way is to use the colons property like above:

```python
display.colons[1] = False
```

If you would like to set the dots individually, you can do that using the `top_left_dot` and `bottom_left_dot` properties and set them to `True` or `False`:

```python
display.top_left_dot = True
display.bottom_left_dot = True
```

## Setting the AM/PM Indicator

If you would like to set the upper-right dot, you can do this using the `ampm` property:

```python
display.ampm = True
```

## Displaying an Automatic Scrolling Marquee

To make displaying long text easier, we've added a marquee function. You just pass it the full string. Optionally, you can pass it the amount of delay between each character. This may be useful for displaying a phone number, words using only letters A-F, or other numeric data:

```python
display.marquee('Deadbeef ')
```

![](https://cdn-learn.adafruit.com/assets/assets/000/087/751/medium800thumb/led_matrices_marquee.jpg?1580237154)

By default it is 0.25 seconds, but you can change this by providing a second parameter. You can optionally pass&nbsp;`False`&nbsp;for a third parameter if you would not like to have it loop. So if you wanted each character to display for half a second and didn't want it to loop, you would use the following:

```python
display.marquee('Deadbeef', 0.5, False)
```

# Adafruit LED Backpacks

## Bi-Color 8x8 Matrix

This version of the LED backpack is designed for these bright and colorful square=pixeled 8x8 matrices. They have 64 red and 64 green LEDs inside, for a total of 128 LEDs controlled as a 8x16 matrix.&nbsp;This backpack solves the annoyance of using 24 pins or a bunch of chips by having an I2C constant-current matrix controller sit neatly on the back of the PCB. The controller chip takes care of everything, drawing all 128 LEDs in the background. All you have to do is write data to it using the 2-pin I2C interface. There are three address select pins so you can select one of 8 addresses to control up to 8 of these on a single 2-pin I2C bus (as well as whatever other I2C chips or sensors you like). The driver chip can 'dim' the entire display from 1/16 brightness up to full brightness in 1/16th steps. It cannot dim individual LEDs, only the entire display at once.

![](https://cdn-learn.adafruit.com/assets/assets/000/000/350/medium800/led_matrix_ID902_LRG.jpg?1396762374)

# Adafruit LED Backpacks

## Assembly

Danger: 

When you buy a pack from Adafruit, it comes with the fully tested and assembled backpack as well as a 8x8 matrix. You'll need to solder the matrix onto the backpack but its an easy task.![led_matrix_ID902front_LRG.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/000/524/medium640/led_matrix_ID902front_LRG.jpeg?1396763747)

Remove the parts from packaging and place the LED matrix OVER the silkscreen side.&nbsp;  
  
**The matrix must be soldered on the correct orientation or it will not work! Check for the side of the matrix that has printing on it. Then look for the front of the PCB that has a circle instead of a square in the corner and line those up as shown on the left**  
  
Do not solder the matrix over the chip on the back of the backpack - it will not work then!

![led_matrix_bicoloralign.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/000/525/medium640/led_matrix_bicoloralign.jpeg?1396763754)

Turn the backpack over so its sitting flat on the matrix.![led_matrix_flip.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/000/526/medium640/led_matrix_flip.jpeg?1396763762)

Solder all 24 pins.![led_matrix_bicolorsolder.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/000/527/medium640/led_matrix_bicolorsolder.jpeg?1396763772)

Clip the long pins![led_matrix_clip.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/000/528/medium640/led_matrix_clip.jpeg?1396763779)

![led_matrix_clipped.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/000/529/medium640/led_matrix_clipped.jpeg?1396763788)

Now you're ready to wire it up to a microcontroller. We'll assume you want to use a 4pin header. You can also of course solder wires directly. Place a 4-pin piece of header with the LONG pins down into the breadboard.![led_matrix_bbplace.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/000/530/medium640/led_matrix_bbplace.jpeg?1396763794)

Place the soldered backpack on top of the header.![led_matrix_headerplace.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/000/531/medium640/led_matrix_headerplace.jpeg?1396763803)

Solder 'em!![led_matrix_solderheader.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/000/532/medium640/led_matrix_solderheader.jpeg?1396763813)

# Adafruit LED Backpacks

## Arduino Setup

Primary: 

We wrote a basic library to help you work with the bi-color&nbsp;8x8 matrix backpack. The library is written for the Arduino and will work with any Arduino as it just uses the I2C pins. The code is very portable and can be easily adapted to any I2C-capable micro.

Wiring to the matrix is really easy

- Connect&nbsp; **CLK** to the I2C clock - on Arduino UNO thats Analog #5 (or SCL), on the Leonardo its Digital #3, on the Mega its digital #21
- Connect&nbsp; **DAT** to the I2C data - on Arduino UNO thats Analog #4 (or SDA), on the Leonardo its Digital #2, on the Mega its digital #20
- Connect&nbsp; **GND** &nbsp;to common ground
- Connect&nbsp; **VCC+** &nbsp;to power - 5V is best but 3V also seems to work for 3V microcontrollers.

Next, download the&nbsp; **Adafruit LED Backpack&nbsp;** library and the&nbsp; **Adafruit GFX&nbsp;** library from the Arduino library manager.

Open up the Arduino library manager:

![](https://cdn-learn.adafruit.com/assets/assets/000/084/477/medium800/led_matrices_1library_manager_menu.png?1574048245)

Search for the&nbsp; **Adafruit LED Backpack&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/478/medium800/led_matrices_led_backpack.png?1574048285)

Search for the&nbsp; **Adafruit GFX&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/479/medium800/led_matrices_gfx.png?1574048523)

If using an earlier version of the Arduino IDE (prior to 1.8.10), also locate and install **Adafruit\_BusIO** (newer versions will install this dependency automatically).

Once you've restarted you should be able to select the **File→Examples→Adafruit\_LEDBackpack→bicolor88** example sketch. Upload it to your Arduino as usual. You should see a basic test program that goes through a bunch of different drawing routines.

We also have a great tutorial on Arduino library installation at:  
[http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use "Link: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use")

![](https://cdn-learn.adafruit.com/assets/assets/000/000/363/medium800/led_matrix_ID902_LRG.jpg?1396762455)

Once you're happy that the matrix works, you can write your own sketches. The 8x8 matrix supports everything the Adafruit GFX library - drawing pixels, lines, rectangles, circles, triangles, roundrects, and small bitmaps. [For more details check out the GFX page which will detail all of the GFX routines](http://learn.adafruit.com/adafruit-gfx-graphics-library).

 

All the drawing routines only change the display memory kept by the Arduino. Don't forget to call **writeDisplay()** after drawing to 'save' the memory out to the matrix via I2C.

 

There are also a few small routines that are special to the matrix:

 
- **setBrightness(_brightness_)**- will let you change the overall brightness of the entire display. 0 is least bright, 15 is brightest and is what is initialized by the display when you start
- **blinkRate(_rate_)** - You can blink the entire display. 0 is no blinking. 1, 2 or 3 is for display blinking.

The default orientation for graphics commands on this display places pixel (0,0) at the top-left when the header is at the left and Adafruit logo at the right. To use the matrix as shown above (header at top, logo at bottom), call matrix.setRotation(3) before issuing graphics commands.

![led_matrix_bicolor-orient.jpg](https://cdn-learn.adafruit.com/assets/assets/000/010/759/medium640/led_matrix_bicolor-orient.jpg?1378179688)

# Adafruit LED Backpacks

## CircuitPython Wiring and Setup

# Wiring

It's easy to use LED Matrices with CircuitPython and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This module allows you to easily write CircuitPython code to control the display.

You can use this sensor with any CircuitPython microcontroller board.

We'll cover how to wire the LED Matrix to your CircuitPython microcontroller board. First assemble your LED Matrix.

Connect the LED Matrix to your microcontroller board as shown below.

- **Microcontroller 3V&nbsp;** to **LED Matrix VIN**
- **Microcontroller GND&nbsp;** to **LED Matrix&nbsp;GND**
- **Microcontroller SCL&nbsp;** to **LED Matrix&nbsp;SCL**
- **Microcontroller SDA&nbsp;** to **LED Matrix&nbsp;SDA**

![led_matrices_feather-m4-bicolor-8x8_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/087/071/medium640/led_matrices_feather-m4-bicolor-8x8_bb.jpg?1579290259)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/087/076/original/feather-m4-bicolor-8x8.fzz?1579290455)
# Library Setup

To use the LED backpack&nbsp;with your&nbsp;[Adafruit CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/overview)&nbsp;board you'll need to install the&nbsp;[Adafruit\_CircuitPython\_HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library on your board.

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://github.com/adafruit/circuitpython/releases)&nbsp;for your board. &nbsp;Next you'll need to install the necessary libraries&nbsp;to use the hardware--read below and carefully follow the referenced steps to find and install these libraries from [Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).

## Bundle Install

For express boards that have extra flash storage, like the Feather/Metro M0 express and Circuit Playground express, you can easily install the necessary libraries with [Adafruit's CircuitPython bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle). &nbsp;This is an all-in-one package that includes the necessary libraries to use the LED backpack display with CircuitPython. For details on installing the bundle, read about [CircuitPython Libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

Remember for non-express boards like the Trinket M0, Gemma M0, and Feather/Metro M0 basic you'll need to [manually install the necessary libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries#non-express-boards-11-13) from the bundle:

- **adafruit\_ht16k33**
- **adafruit\_bus\_device**

If your board supports USB mass storage, like the M0-based boards, then simply drag the files to the board's file system.&nbsp;**Note on boards without external SPI flash, like a Feather M0 or Trinket/Gemma M0, you might run into issues on Mac OSX with hidden files taking up too much space when drag and drop copying,&nbsp;[see this page for a workaround](../../../../micropython-for-samd21/usb-mass-storage#mac-osx-file-copy-issues).**

Before continuing make sure your board's **lib** folder or root filesystem has at least the&nbsp; **adafruit\_ht16k33** and&nbsp; **adafruit\_bus\_device** &nbsp;folders/modules copied over.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/533/medium800/led_matrices_circuitpy.png?1579983230)

# Adafruit LED Backpacks

## Python Wiring and Setup

# Wiring

It's easy to use LED Matrices with Python and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This library allows you to easily write Python code to control the display.

We'll cover how to wire the LED Matrix to your Raspberry Pi. First assemble your LED Matrix.

Since there's _dozens_ of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Connect the LED Matrix as shown below to your Raspberry Pi.

- **Raspberry Pi 3.3V&nbsp;** to **&nbsp;LED Matrix VIN**
- **Raspberry Pi GND&nbsp;** to **LED Matrix&nbsp;GND**
- **Raspberry Pi SCL&nbsp;** to **LED Matrix&nbsp;SCL**
- **Raspberry Pi SDA&nbsp;** to **LED Matrix&nbsp;SDA**

![led_matrices_raspberry-pi-bicolor-8x8_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/087/074/medium640/led_matrices_raspberry-pi-bicolor-8x8_bb.jpg?1579290417)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/087/075/original/raspberry-pi-bicolor-8x8.fzz?1579290427)
# Setup

You'll need to install the Adafruit\_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

## Python Installation of HT16K33 Library

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-ht16k33`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

If that complains about pip3 not being installed, then run this first to install it:

- `sudo apt-get install python3-pip`

## Pillow Library

We also need PIL, the Python Imaging Library, to allow using text with custom fonts. There are several system libraries that PIL relies on, so installing via a package manager is the easiest way to bring in everything:

- `sudo apt-get install python3-pil`

That's it. You should be ready to go.

# Adafruit LED Backpacks

## CircuitPython and Python Usage

The following section will show how to control the LED backpack&nbsp;from the board's Python prompt / REPL. &nbsp;You'll walk through how to control the LED display and learn how to use the CircuitPython module built for the display.

First&nbsp;[connect to the board's serial REPL&nbsp;](https://learn.adafruit.com/welcome-to-circuitpython/the-repl)so you are at the CircuitPython&nbsp; **\>\>\>** &nbsp;prompt.

## Initialization

First you'll need to initialize the I2C bus for your board.&nbsp; It's really easy, first import the necessary modules. In this case, we'll use `board` and `Matrix8x8x2`.

Then just use `board.I2C()` to create the I2C instance using the default SCL and SDA pins (which will be marked on the boards pins if using a Feather or similar Adafruit board).

Then to initialize the matrix, you just pass `i2c` in.

Warning: When using the STEMMA QT port, some board may have an alternate I2C such as board.STEMMA_I2C().

```python
import board
from adafruit_ht16k33.matrix import Matrix8x8x2

i2c = board.I2C()
matrix = Matrix8x8x2(i2c)
```

If you bridged the address pads on the back of the display, you could pass in the address. The addresses for the HT16K33 can range between 0x70 and 0x77 depending on which pads you have bridged, with 0x70 being used if you haven't bridged any of them. For instance, if you bridge only the **A0** pad, you would use `0x71` like this:

```python
matrix = Matrix8x8x2(i2c, address=0x71)
```

## Setting the Brightness

You can set the brightness of the display, but changing it will set the brightness of the entire display and not individual segments. If can be adjusted in 1/16 increments **between 0 and 1.0** with 1.0 being the brightest. So to set the display to half brightness, you would use the following:

```python
display.brightness = 0.5
```

## Setting the Blink Rate

You can also set the blink rate of the display. It can be adjusted in increments&nbsp; **between 0 and 3** , with 3 being the slowest blinking. So to set the display to blink at the slowest speed, you would use the following:

```python
display.blink_rate = 3
```

## Setting Individual Pixels

To set individual pixels to specific colors, you simply treat the `matrix` object as a multidimensional list and set it to` matrix.LED_RED`,` matrix.LED_GREEN`,` matrix.LED_YELLOW` or` matrix.LED_OFF`.

```python
matrix[0, 0] = matrix.LED_RED
matrix[4, 4] = matrix.LED_GREEN
matrix[7, 7] = matrix.LED_YELLOW
matrix[7, 0] = matrix.LED_OFF
```

![](https://cdn-learn.adafruit.com/assets/assets/000/087/752/medium800/led_matrices_IMG_1545.jpeg?1580237559)

## Filling the Entire Matrix

To fill the entire matrix, just use the fill() function and pass in the color you want to set it to. For instance, if you wanted to set everything to green, you would use:

```python
matrix.fill(matrix.LED_GREEN)
```

## Shifting the Matrix

To shift the pixels on the matrix, there are 5 functions you can use. The main function, called shift(), is used to shift the pixels, up, down, left, right, or even diagonally. By passing a positive number, it will shift the pixels right/up and passing a negative number will shift them left/down. For instance:

```python
matrix.shift(2, 0)	# shift pixels to the right by 2
matrix.shift(-1, 0)	# shift pixels to the left by 1
matrix.shift(0, -3)	# shift pixels down by 3
matrix.shift(-2, 2)	# shift pixels left by 2 and up by 2
```

You can pass `True` as a third parameter to loop all the pixels that get shifted off over to the other side.

```python
matrix.shift(2, 0, True)	# loop pixels to the right by 2
matrix.shift(-1, 0, True)	# loop pixels to the left by 1
matrix.shift(0, -3, True)	# loop pixels down by 3
matrix.shift(-2, 2, True)	# loop pixels left by 2 and up by 2
```

Additionally, there are a few convenience functions that will shift the pixels by one. These can also be passed a value of `True` to loop the pixels.

```python
matrix.shift_up()		# Shift pixels up
matrix.shift_left()		# Shift pixels left
matrix.shift_down()		# Shift pixels down
matrix.shift_right()		# Shift pixels right
matrix.shift_up(True)		# Loop pixels up
matrix.shift_left(True)	# Loop pixels left
matrix.shift_down(True)	# Loop pixels down
matrix.shift_right(True)	# Loop pixels right
```

## Displaying an Image (Pillow Only)

Additionally, when using with the Raspberry Pi, you can use the Pillow library to display an image to the Matrix. The image will need to be the same exact size as the Matrix and should include pure Green, Red, or Yellow. Anything else will be considered to be **off**. In this case, it should be **8x8** pixels. As an example, you can save the image below as **myimage.png**.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/755/medium800/led_matrices_squares-color.png?1580237815)

[Download Image](https://cdn-learn.adafruit.com/assets/assets/000/087/755/original/led_matrices_squares-color.png?1580237815)
Then if you want to display the image called **myimage.png** , you would use something like this:

```python
import board
from PIL import Image
from adafruit_ht16k33 import matrix

matrix = matrix.Matrix8x8x2(board.I2C())

image = Image.open("myimage.png")
matrix.image(image)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/087/753/medium800/led_matrices_IMG_1544.jpeg?1580237590)

# Adafruit LED Backpacks

## Bi-Color 24 Bargraph

This version of the LED backpack is designed for these bright and colorful bi-color bargraph modules. Each module has 12 red and 12 green LEDs inside, for a total of 24 LEDs controlled as a 1x12 matrix. We put two modules on each backpack for a 24-bar long bargraph (48 total LEDs).   
  
This backpack solves the annoyance of using lots of pins or a bunch of chips by having an I2C constant-current matrix controller sit neatly on the back of the PCB. The controller chip takes care of everything, drawing all 48 LEDs in the background. All you have to do is write data to it using the 2-pin I2C interface. There are three address select pins so you can select one of 8 addresses to control up to 8 of these on a single 2-pin I2C bus (as well as whatever other I2C chips or sensors you like). The driver chip can 'dim' the entire display from 1/16 brightness up to full brightness in 1/16th steps. It cannot dim individual LEDs, only the entire display at once.

![](https://cdn-learn.adafruit.com/assets/assets/000/014/587/medium800/led_matrix_1721_LRG.jpg?1393443690)

# Adafruit LED Backpacks

## Assembly

Danger: 

Remove the parts from packaging and place the LED bargraphs over the outlines on the top of the PCB.  
  
**The bargraph must be soldered on the correct orientation or it will not work! Check for the side of the bargraph that has printing on it. Then look for the outline on the PCB that has "Text on this side" marked!**  
  
Do not solder the matrix onto the back of the PCB, it won't work either!

![](https://cdn-learn.adafruit.com/assets/assets/000/014/482/medium800/led_matrix_textonthisside.jpg?1392834926)

![](https://cdn-learn.adafruit.com/assets/assets/000/014/483/medium800/led_matrix_inserting.jpg?1392835011)

![](https://cdn-learn.adafruit.com/assets/assets/000/014/484/medium800/led_matrix_inserted.jpg?1392835021)

To keep the two bargraphs lined up nicely, you can use a little masking or scotch tape on the bargraph modules, tape them so they are in a straight line. There is a little play during soldering so if you don't do this the two modules may not be in a perfect line.

![](https://cdn-learn.adafruit.com/assets/assets/000/014/485/medium800/led_matrix_tape.jpg?1392835030)

Turn over the PCB and bend opposite-corner pins of the modules out so that the modules are fixed in place against the PCB. Now is a good time to do a last check that you oriented the modules the right way!

![led_matrix_poke.jpg](https://cdn-learn.adafruit.com/assets/assets/000/014/486/medium640/led_matrix_poke.jpg?1392835648)

Solder all the module pins in!

![led_matrix_solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/014/487/medium640/led_matrix_solder.jpg?1392835688)

![led_matrix_solder1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/014/488/medium640/led_matrix_solder1.jpg?1392835698)

![led_matrix_solder2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/014/489/medium640/led_matrix_solder2.jpg?1392835732)

![led_matrix_soldering3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/014/490/medium640/led_matrix_soldering3.jpg?1392835747)

OK nice work!

![led_matrix_soldered.jpg](https://cdn-learn.adafruit.com/assets/assets/000/014/492/medium640/led_matrix_soldered.jpg?1392835812)

Once soldered, clip each pin. They're quite short and the pins are thicker than usual, so do this over/inside a trash bin so that the pins don't fly off and it you or your pets.

![led_matrix_clip.jpg](https://cdn-learn.adafruit.com/assets/assets/000/014/491/medium640/led_matrix_clip.jpg?1392835760)

Everything should be neat and clipped, you're done!

![led_matrix_done.jpg](https://cdn-learn.adafruit.com/assets/assets/000/014/493/medium640/led_matrix_done.jpg?1392835846)

# Soldering on breadboard pins
  
This is an optional step - you only need to do this step if you're planning on using the bargraph in a breadboard. Chances are you may want to solder wires directly to the pads instead, so you can mount the bargraph elsewhere. Anyhow, skip this step if its not for you!  
Break off a piece of male header, 4 pins long. Plug the **long ends** into a solderless breadboard.

![led_matrix_placepins.jpg](https://cdn-learn.adafruit.com/assets/assets/000/014/494/medium640/led_matrix_placepins.jpg?1392836037)

Place the PCB on top. you may need to support it a little since its quite long.

![led_matrix_place.jpg](https://cdn-learn.adafruit.com/assets/assets/000/014/497/medium640/led_matrix_place.jpg?1392836143)

Solder these 4 pins too, since you're good at it now this should be easy.

![led_matrix_solderpin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/014/496/medium640/led_matrix_solderpin.jpg?1392836102)

![led_matrix_solderedpins.jpg](https://cdn-learn.adafruit.com/assets/assets/000/014/498/medium640/led_matrix_solderedpins.jpg?1392836162)

# Adafruit LED Backpacks

## Arduino Wiring and Setup

Primary: 

We wrote a basic library to help you work with the bi-color bargraph backpack. The library is written for the Arduino and will work with any Arduino as it just uses the I2C pins. The code is very portable and can be easily adapted to any I2C-capable micro.

Wiring to the bargraph is really easy

- Connect **SCL** to the I2C clock - on Arduino UNO thats Analog #5 (or SCL), on the Leonardo its Digital #3, on the Mega its digital #21
- Connect **SDA** to the I2C data - on Arduino UNO thats Analog #4 (or SDA), on the Leonardo its Digital #2, on the Mega its digital #20
- Connect **GND** to common ground
- Connect **VCC+** to power - 5V is best but 3V also seems to work for 3V microcontrollers.

![](https://cdn-learn.adafruit.com/assets/assets/000/014/499/medium800/led_matrix_wiring.jpg?1392836394)

Next, download the&nbsp; **Adafruit LED Backpack&nbsp;** library and the&nbsp; **Adafruit GFX&nbsp;** library from the Arduino library manager.

Open up the Arduino library manager:

![](https://cdn-learn.adafruit.com/assets/assets/000/084/480/medium800/led_matrices_1library_manager_menu.png?1574048650)

Search for the&nbsp; **Adafruit LED Backpack&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/481/medium800/led_matrices_led_backpack.png?1574048741)

Search for the&nbsp; **Adafruit GFX&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/482/medium800/led_matrices_gfx.png?1574048789)

If using an earlier version of the Arduino IDE (prior to 1.8.10), also locate and install **Adafruit\_BusIO** (newer versions will install this dependency automatically).

Once you've restarted you should be able to select the **File→Examples→Adafruit\_LEDBackpack→bargraph24** example sketch. Upload it to your Arduino as usual. You should see a basic test program that tests all the LEDs with different colors.

We also have a great tutorial on Arduino library installation at:  
[http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use "Link: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use")

![](https://cdn-learn.adafruit.com/assets/assets/000/014/588/medium800/led_matrix_1721arduino_LRG.jpg?1393443705)

Using the library interface is very easy. Start by creating the object with  

> **Adafruit\_24bargraph bar = Adafruit\_24bargraph();**

you can name it whatever you want, not just **bar**  
  
Then initialize it with   

> **bar.begin(0x70); // pass in the address**

You can init with any address from 0x70 to 0x77, just make sure you solder in the matching solder jumpers!  
  
Finally, write to the bargraph with  

> **bar.setBar(**_ **lednumber** _ **,** _ **ledcolor** _**);**

Where _lednumber_ is 0 thru 23. _ledcolor_ can be **LED\_RED, LED\_YELLOW, LED\_GREEN** or **LED\_OFF**  

The drawing routines only change the display memory kept by the Arduino. Don't forget to call **bar.writeDisplay()** after drawing to 'save' the memory out to the matrix via I2C.

 

There are also a few small routines that are special to the matrix:

 
- **setBrightness(_brightness_)**- will let you change the overall brightness of the entire display. 0 is least bright, 15 is brightest and is what is initialized by the display when you start
- **blinkRate(_rate_)** - You can blink the entire display. 0 is no blinking. 1, 2 or 3 is for display blinking.

# Adafruit LED Backpacks

## CircuitPython Wiring and Setup

# Wiring

It's easy to use LED Matrices with CircuitPython and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This module allows you to easily write CircuitPython code to control the display.

You can use this sensor with any CircuitPython microcontroller board.

We'll cover how to wire the Bargraph to your CircuitPython microcontroller board. First assemble your Bargraph.

Connect the Bargraph to your microcontroller board as shown below.

- **Microcontroller 3V&nbsp;** to **&nbsp;Bargraph VIN**
- **Microcontroller GND&nbsp;** to **Bargraph&nbsp;GND**
- **Microcontroller SCL&nbsp;** to **Bargraph&nbsp;SCL**
- **Microcontroller SDA&nbsp;** to **Bargraph&nbsp;SDA**

![led_matrices_feather-m4-bargraph_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/921/medium640/led_matrices_feather-m4-bargraph_bb.jpg?1579045383)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/087/062/original/feather-m4-bargraph.fzz?1579283261)
# Library Setup

To use the LED backpack&nbsp;with your&nbsp;[Adafruit CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/overview)&nbsp;board you'll need to install the&nbsp;[Adafruit\_CircuitPython\_HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library on your board.

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://github.com/adafruit/circuitpython/releases)&nbsp;for your board. &nbsp;Next you'll need to install the necessary libraries&nbsp;to use the hardware--read below and carefully follow the referenced steps to find and install these libraries from [Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).

## Bundle Install

For express boards that have extra flash storage, like the Feather/Metro M0 express and Circuit Playground express, you can easily install the necessary libraries with [Adafruit's CircuitPython bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle). &nbsp;This is an all-in-one package that includes the necessary libraries to use the LED backpack display with CircuitPython. For details on installing the bundle, read about [CircuitPython Libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

Remember for non-express boards like the Trinket M0, Gemma M0, and Feather/Metro M0 basic you'll need to [manually install the necessary libraries](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries#non-express-boards-11-13) from the bundle:

- **adafruit\_ht16k33**
- **adafruit\_bus\_device**

If your board supports USB mass storage, like the M0-based boards, then simply drag the files to the board's file system.&nbsp;**Note on boards without external SPI flash, like a Feather M0 or Trinket/Gemma M0, you might run into issues on Mac OSX with hidden files taking up too much space when drag and drop copying,&nbsp;[see this page for a workaround](../../../../micropython-for-samd21/usb-mass-storage#mac-osx-file-copy-issues).**

Before continuing make sure your board's **lib** folder or root filesystem has at least the&nbsp; **adafruit\_ht16k33** and&nbsp; **adafruit\_bus\_device** &nbsp;folders/modules copied over.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/100/medium800/led_matrices_circuitpy.png?1579297236)

# Adafruit LED Backpacks

## Python Wiring and Setup

# Wiring

It's easy to use LED Matrices with Python and the [Adafruit CircuitPython HT16K33](https://github.com/adafruit/Adafruit_CircuitPython_HT16K33) library.&nbsp; This library allows you to easily write Python code to control the display.

We'll cover how to wire the Bargraph to your Raspberry Pi. First assemble your Bargraph.

Since there's _dozens_ of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Connect the Bargraph as shown below to your Raspberry Pi.

- **Raspberry Pi 3.3V&nbsp;** to **&nbsp;Bargraph VIN**
- **Raspberry Pi GND&nbsp;** to **Bargraph&nbsp;GND**
- **Raspberry Pi SCL&nbsp;** to **Bargraph&nbsp;SCL**
- **Raspberry Pi SDA&nbsp;** to **Bargraph&nbsp;SDA**

![led_matrices_raspberry-pi-bargraph_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/086/922/medium640/led_matrices_raspberry-pi-bargraph_bb.jpg?1579045534)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/087/063/original/raspberry-pi-bargraph.fzz?1579283291)
# Setup

You'll need to install the Adafruit\_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

## Python Installation of HT16K33 Library

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-ht16k33`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

If that complains about pip3 not being installed, then run this first to install it:

- `sudo apt-get install python3-pip`

That's it. You should be ready to go.

# Adafruit LED Backpacks

## CircuitPython and Python Usage

The following section will show how to control the LED backpack&nbsp;from the board's Python prompt / REPL. &nbsp;You'll walk through how to control the LED display and learn how to use the CircuitPython module built for the display.

First&nbsp;[connect to the board's serial REPL&nbsp;](https://learn.adafruit.com/welcome-to-circuitpython/the-repl)so you are at the CircuitPython&nbsp; **\>\>\>** &nbsp;prompt.

## Initialization

First you'll need to initialize the I2C bus for your board.&nbsp; It's really easy, first import the necessary modules. In this case, we'll use `board` and `BiColor24`.

Then just use `board.I2C()` to create the I2C instance using the default SCL and SDA pins (which will be marked on the boards pins if using a Feather or similar Adafruit board).

Then to initialize the bargraph, you just pass `i2c` in.

Warning: When using the STEMMA QT port, some board may have an alternate I2C such as board.STEMMA_I2C().

```python
import board
from adafruit_ht16k33.bargraph import Bicolor24

i2c = board.I2C()
bc24 = Bicolor24(i2c)
```

If you bridged the address pads on the back of the display, you could pass in the address. The addresses for the HT16K33 can range between 0x70 and 0x77 depending on which pads you have bridged, with 0x70 being used if you haven't bridged any of them. For instance, if you bridge only the **a0** pad, you would use `0x71` like this:

```python
bc24 = Bicolor24(i2c, address=0x71)
```

## Setting the Brightness

You can set the brightness of the display, but changing it will set the brightness of the entire display and not individual segments. If can be adjusted in 1/16 increments&nbsp; **between 0 and 1.0** with 1.0 being the brightest. So to set the display to half brightness, you would use the following:

```python
display.brightness = 0.5
```

## Setting the Blink Rate

You can also set the blink rate of the display. It can be adjusted in increments&nbsp; **between 0 and 3** , with 3 being the slowest blinking. So to set the display to blink at the slowest speed, you would use the following:

```python
display.blink_rate = 3
```

## Setting Individual Bars

To set individual bars to specific colors, you simply treat the `bc24` object as a list and set it to `bc24.LED_RED`, `bc24.LED_GREEN`, `bc24.LED_YELLOW` or `bc24.LED_OFF`.

```python
bc24[0] = bc24.LED_RED
bc24[1] = bc24.LED_GREEN
bc24[2] = bc24.LED_YELLOW
bc24[3] = bc24.LED_OFF
```

## Filling the Entire Bargraph

To fill the entire bargraph, just use the fill() function and pass in the color you want to set it to. For instance, if you wanted to set everything to green, you would use:

```python
bc24.fill(bc24.LED_GREEN)
```

# Adafruit LED Backpacks

## Connecting Multiple Backpacks

The coolest part about the I2C backpacks is that you can connect more than one using just the same 2 pins. &nbsp;This opens possibilities for [all kinds of multi-display projects](http://learn.adafruit.com/animating-multiple-led-backpacks/ideas).  
  
[For a project that shows this is practice, check out this page](http://learn.adafruit.com/animating-multiple-led-backpacks) on animating multiple LED backpacks

![](https://cdn-learn.adafruit.com/assets/assets/000/002/325/medium800/led_matrix_jackolantern.jpg?1396781742)

# Wire it Up
To connect another backpack to your project, just wire it in parallel with the first one as in the diagram below.  
Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/002/326/medium800/led_matrix_Untitled_Sketch_2_bb-1024.jpg?1396781752)

# Configure the Address
For each backpack you add, you need to configure a different I2C address. &nbsp;You can keep adding backpacks in the same way until you run out of addresses. &nbsp;See the next page for how to configure the address on your backpack.# Adafruit LED Backpacks

## Changing I2C Address

The HT16K33 driver chip on these LED backpacks has a default I2C address of **0x70**. Since each device on an I2C bus must have a unique address, its important to avoid collisions or you'll get a lot of strange responses from your electronic devices!   
  
Luckily, the HT16K33 has 2 or 3 address adjust pins, so that the address can be changed! The mini 0.8" 8x8 matrix backpack has 2 address adjust pins. The 1.2" 8x8, bi-color 8x8, bi-color bargraph and 4 x 7-segment backpacks have 3 address adjust pins.   
  
That means that you can set the backpacks to these addresses:

- **Mini 0.8" 8x8:** 0x70, 0x71, 0x72, 0x73
- **Small 1.2" 8x8:** 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77
- **4 x 7-segment:** 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77
- **Bi-color 1.2" 8x8:** 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77
- **Bi-color 24-bargraph:** 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77

You can mix-and-match matrices, as long as each one has a unique address!  
  

## Changing Addresses
You can change the address of a backpack very easily. Look on the back to find the two or three **A0, A1 or A2** solder jumpers. Each one of these is used to hardcode in the address. If a jumper is shorted with solder, that sets the address. **A0** sets the lowest bit with a value of **1** , **A1** sets the middle bit with a value of **2** and **A2** sets the high bit with a value of **4**. The final address is **0x70 + A2 + A1 + A0**. So for example if **A2** is shorted and **A0** is shorted, the address is **0x70 + 4 + 1 = 0x75.** If only A1 is shorted, the address is **0x70 + 2 = 0x72**  
  
**A2** does not appear on the mini 0.8" 8x8 matrix, so you cannot set the address higher than 0x73  
  
Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/002/121/medium800/led_matrix_7segjumper.jpg?1396779522)

![](https://cdn-learn.adafruit.com/assets/assets/000/002/122/medium800/led_matrix_mono8x8jumper.jpg?1396779525)

# Changing the address in your code
  
Once you've adjusted the address on the backpack, you'll also want to adjust the address in the code!  
For the Arduino library we wrote, its simple. For example, lets say you want to have two seven-segment matrices. One is set to address 0x70 and the other is set to 0x71. Find this code in the example  
```
Adafruit_7segment matrix = Adafruit_7segment();

void setup() {
  Serial.begin(9600);
  Serial.println("7 Segment Backpack Test");

  matrix.begin(0x70);
}
```

And change it to this:

```
Adafruit_7segment matrix1 = Adafruit_7segment();
Adafruit_7segment matrix2 = Adafruit_7segment();

void setup() {
  Serial.begin(9600);
  Serial.println("Double 7 Segment Backpack Test");

  matrix1.begin(0x70);
  matrix2.begin(0x71);
}


```

That is, instantiate two matrix objects. Then one is called with **begin(0x70)** and the other is called with **begin(0x71)**. Each one can be used individually. If you need more matrices, just instantiate more objects at the top and **begin()** each one with the unique i2c address.

# Adafruit LED Backpacks

## F.A.Q.

### 

The best way to get up and running is to read the HT16K33 driver datasheet available at [http://learn.adafruit.com/adafruit-led-backpack/downloads](http://learn.adafruit.com/adafruit-led-backpack/downloads) - the backpacks all use this chip to do all the LED driving. You can cross-reference this document with the Arduino library code to adapt it to your platform. Any microcontroller that has I2C host support should be able to drive the backpacks but we only provide Arduino example code at this time

### 

You're in luck! We have a full tutorial here that covers using the 7-segment and 8x8 matrices on a Pi with Python code -\> [http://learn.adafruit.com/matrix-7-segment-led-backpack-with-the-raspberry-pi](http://learn.adafruit.com/matrix-7-segment-led-backpack-with-the-raspberry-pi)

### 

We are not sure why this occurs but there is an address collision even though the address are different! Set the backpacks to address 0x71 or anything other than the default 0x70 to make the issue go away

### 

It depends on how many LEDs you have lit at once!

But a rough estimation is 20 milliamps per segment. Note that segments are multiplexed per row so that means

- 8x8 Mono Matrix (8 rows)= 8 x 20mA = 160mA max
- 7-segment backpacks (7 segments + 1 dot) = 8 x 20mA = 160 mA
- Alphanumeric (14 segments) = 14 x 20mA = 280mA
- Bi-color 8x8 and 8x16 matrix (16 rows) = 8 x 16 = 320mA

But again, this is _maximum_ and assumes all digits and all segments are lit up! Your average use may be 1/10 to 1/2 of this amount

# Adafruit LED Backpacks

## Downloads

# Software

You'll need to install the following libraries to use any of the LED backpacks.

Open up the Arduino library manager:

![](https://cdn-learn.adafruit.com/assets/assets/000/084/001/medium800/led_matrices_library_manager_menu.png?1573500460)

Search for the&nbsp; **Adafruit LED Backpack** &nbsp;library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/002/medium800/led_matrices_led_backpack.png?1573500560)

Search for the&nbsp; **Adafruit GFX** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/003/medium800/led_matrices_gfx.png?1573500607)

We also have a great tutorial on Arduino library installation at:  
[http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use "Link: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use")

# Files

- [Fritzing objects in Adafruit Fritzing library](https://github.com/adafruit/Fritzing-Library)
- [EagleCAD PCB files for all backpacks in GitHub](https://github.com/adafruit/Adafruit-LED-Backpacks)
- [Alphanumeric STEMMA QT Display 3D models on GitHub](https://github.com/adafruit/Adafruit_CAD_Parts/tree/main/1911%20Alphanumberic%20Display%20STEMMA%20QT)

- [The backpacks all use the HT16K33 chip solely for LED driving](http://www.adafruit.com/datasheets/ht16K33v110.pdf) - the mini 8x8's use the 24 pin version and the others use the 28 pin vesion

# HT16K33 8x16 LED Backpack Breakout

Schematic & fabrication print

![](https://cdn-learn.adafruit.com/assets/assets/000/036/077/medium800/led_matrix_scham.png?1474910745)

![](https://cdn-learn.adafruit.com/assets/assets/000/036/076/medium800/led_matrix_fabprint.png?1474910370)

Danger: NOTE - The silkscreen labels for the A0/A2 header pins are swapped. The silkscreen labels for the solder pads are correct.

# 8x8 0.8" LED Backpack
![](https://cdn-learn.adafruit.com/assets/assets/000/036/422/medium800/led_matrix_schem.png?1476295711)

![](https://cdn-learn.adafruit.com/assets/assets/000/036/423/medium800/led_matrix_fabprint.png?1476295719)

# 8x8 1.2" LED Backpack
![](https://cdn-learn.adafruit.com/assets/assets/000/036/371/medium800/led_matrix_schem.png?1476237880)

![](https://cdn-learn.adafruit.com/assets/assets/000/036/374/medium800/led_matrix_fabprint.png?1476237896)

# 8x8 1.2" Bi-Color LED Backpack
![](https://cdn-learn.adafruit.com/assets/assets/000/125/893/medium800/led_matrices_Schematic.png?1699297785)

![](https://cdn-learn.adafruit.com/assets/assets/000/125/892/medium800/led_matrices_Fab_Print.png?1699297760)

# 16x8 1.2" LED Backpacks
![](https://cdn-learn.adafruit.com/assets/assets/000/036/273/medium800/led_matrix_schem.png?1475865990)

![](https://cdn-learn.adafruit.com/assets/assets/000/036/274/medium800/led_matrix_fabprint.png?1475866004)

# 0.56" 7-Segment LED Backpack STEMMA QT
![](https://cdn-learn.adafruit.com/assets/assets/000/108/790/medium800/led_matrices_LEDBP056_sch.png?1644272763)

![](https://cdn-learn.adafruit.com/assets/assets/000/108/791/medium800/led_matrices_LEDBP056_fab_print.png?1644272807)

# Quad 0.56" 7-Segment Original
![](https://cdn-learn.adafruit.com/assets/assets/000/036/420/medium800/led_matrix_schem.png?1476295151)

![](https://cdn-learn.adafruit.com/assets/assets/000/036/421/medium800/led_matrix_fabprint.png?1476295163)

# Quad 0.54" 14-segment Alphanumeric STEMMA QT Version
![](https://cdn-learn.adafruit.com/assets/assets/000/114/463/medium800/led_matrices_QuadANQT_sch.png?1661283897)

![](https://cdn-learn.adafruit.com/assets/assets/000/114/464/medium800/led_matrices_QuadANQT_fab_print.png?1661283952)

# Quad 0.54" 14-segment Alphanumeric Original Version
![](https://cdn-learn.adafruit.com/assets/assets/000/036/288/medium800/led_matrix_schem.png?1476130900)

![](https://cdn-learn.adafruit.com/assets/assets/000/036/289/medium800/led_matrix_fabprint.png?1476130911)

# Quad 1.2" 7-Segment
![](https://cdn-learn.adafruit.com/assets/assets/000/122/068/medium800/led_matrices_1.2_7-segment_schematic.png?1687481600)

![](https://cdn-learn.adafruit.com/assets/assets/000/122/067/medium800/led_matrices_1.2_7-segment_fab.png?1687481577)

# Bicolor 24-Bargraph
![](https://cdn-learn.adafruit.com/assets/assets/000/036/303/medium800/led_matrix_schem.png?1476210028)

![](https://cdn-learn.adafruit.com/assets/assets/000/036/304/medium800/led_matrix_fabprint.png?1476210037)


## Primary Products

### Adafruit Mini 8x8 LED Matrix w/I2C Backpack - Red

[Adafruit Mini 8x8 LED Matrix w/I2C Backpack - Red](https://www.adafruit.com/product/870)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/870)
[Related Guides to the Product](https://learn.adafruit.com/products/870/guides)
### Adafruit Mini 8x8 LED Matrix w/I2C Backpack - Yellow

[Adafruit Mini 8x8 LED Matrix w/I2C Backpack - Yellow](https://www.adafruit.com/product/871)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/871)
[Related Guides to the Product](https://learn.adafruit.com/products/871/guides)
### Adafruit Mini 0.8" 8x8 LED Matrix w/I2C Backpack - Yellow-Green

[Adafruit Mini 0.8" 8x8 LED Matrix w/I2C Backpack - Yellow-Green](https://www.adafruit.com/product/872)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/872)
[Related Guides to the Product](https://learn.adafruit.com/products/872/guides)
### Adafruit 0.56" 4-Digit 7-Segment Display with I2C Backpack - Red

[Adafruit 0.56" 4-Digit 7-Segment Display with I2C Backpack - Red](https://www.adafruit.com/product/878)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/878)
[Related Guides to the Product](https://learn.adafruit.com/products/878/guides)
### Adafruit 0.56" 4-Digit 7-Segment Display w/I2C Backpack - Yellow

[Adafruit 0.56" 4-Digit 7-Segment Display w/I2C Backpack - Yellow](https://www.adafruit.com/product/879)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/879)
[Related Guides to the Product](https://learn.adafruit.com/products/879/guides)
### Adafruit 0.56" 4-Digit 7-Segment Display w/ I2C Backpack - Green

[Adafruit 0.56" 4-Digit 7-Segment Display w/ I2C Backpack - Green](https://www.adafruit.com/product/880)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/880)
[Related Guides to the Product](https://learn.adafruit.com/products/880/guides)
### Adafruit 0.56" 4-Digit 7-Segment Display w/ I2C Backpack - Blue

[Adafruit 0.56" 4-Digit 7-Segment Display w/ I2C Backpack - Blue](https://www.adafruit.com/product/881)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/881)
[Related Guides to the Product](https://learn.adafruit.com/products/881/guides)
### Adafruit Bicolor LED Square Pixel Matrix with I2C Backpack

[Adafruit Bicolor LED Square Pixel Matrix with I2C Backpack](https://www.adafruit.com/product/902)
What's better than a single LED? Lots of LEDs! A fun way to make a small colorful display is to use a [1.2" Bi-color 8x8 LED Matrix](http://www.adafruit.com/products/458). Matrices like these are 'multiplexed' - so to control all the 128 LEDs you need 24 pins....

Out of Stock
[Buy Now](https://www.adafruit.com/product/902)
[Related Guides to the Product](https://learn.adafruit.com/products/902/guides)
### Adafruit Mini 8x8 LED Matrix w/I2C Backpack - Blue

[Adafruit Mini 8x8 LED Matrix w/I2C Backpack - Blue](https://www.adafruit.com/product/959)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/959)
[Related Guides to the Product](https://learn.adafruit.com/products/959/guides)
### Adafruit 0.56" 4-Digit 7-Segment Display w/I2C Backpack - White

[Adafruit 0.56" 4-Digit 7-Segment Display w/I2C Backpack - White](https://www.adafruit.com/product/1002)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/1002)
[Related Guides to the Product](https://learn.adafruit.com/products/1002/guides)
### Adafruit 1.2" 8x8 LED Matrix Backpack

[Adafruit 1.2" 8x8 LED Matrix Backpack](https://www.adafruit.com/product/1048)
By popular request, you can now get our 8x8 LED backpacks without the LEDs! These backpacks feature an HT16K33 I2C LED driver, they're simple and easy to use - you can use&nbsp;[our very nice library for the backpacks to...](https://github.com/adafruit/Adafruit-LED-Backpack-Library)

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1048)
[Related Guides to the Product](https://learn.adafruit.com/products/1048/guides)
### Adafruit Small 1.2" 8x8 LED Matrix w/I2C Backpack - Red

[Adafruit Small 1.2" 8x8 LED Matrix w/I2C Backpack - Red](https://www.adafruit.com/product/1049)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1049)
[Related Guides to the Product](https://learn.adafruit.com/products/1049/guides)
### Adafruit Small 1.2" 8x8 LED Matrix w/I2C Backpack - Yellow

[Adafruit Small 1.2" 8x8 LED Matrix w/I2C Backpack - Yellow](https://www.adafruit.com/product/1050)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/1050)
[Related Guides to the Product](https://learn.adafruit.com/products/1050/guides)
### Adafruit Small 1.2" 8x8 LED Matrix w/I2C Backpack - Blue

[Adafruit Small 1.2" 8x8 LED Matrix w/I2C Backpack - Blue](https://www.adafruit.com/product/1052)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/1052)
[Related Guides to the Product](https://learn.adafruit.com/products/1052/guides)
### Adafruit Mini 8x8 LED Matrix w/I2C Backpack - Ultra Bright White

[Adafruit Mini 8x8 LED Matrix w/I2C Backpack - Ultra Bright White](https://www.adafruit.com/product/1080)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/1080)
[Related Guides to the Product](https://learn.adafruit.com/products/1080/guides)
### Adafruit 1.2" 4-Digit 7-Segment Display w/I2C Backpack - Green

[Adafruit 1.2" 4-Digit 7-Segment Display w/I2C Backpack - Green](https://www.adafruit.com/product/1268)
What's better than a single LED? Lots of LEDs! A fun way to make a numeric display is to use a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). LED matrices like these are 'multiplexed' - so to control all the seven-segment LEDs you need 14 pins....

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1268)
[Related Guides to the Product](https://learn.adafruit.com/products/1268/guides)
### Adafruit 1.2" 4-Digit 7-Segment Display w/I2C Backpack - Yellow

[Adafruit 1.2" 4-Digit 7-Segment Display w/I2C Backpack - Yellow](https://www.adafruit.com/product/1269)
What's better than a single LED? Lots of LEDs! A fun way to make a numeric display is to use a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). LED matrices like these are 'multiplexed' - so to control all the seven-segment LEDs you need 14 pins....

In Stock
[Buy Now](https://www.adafruit.com/product/1269)
[Related Guides to the Product](https://learn.adafruit.com/products/1269/guides)
### Adafruit 1.2" 4-Digit 7-Segment Display w/I2C Backpack - Red

[Adafruit 1.2" 4-Digit 7-Segment Display w/I2C Backpack - Red](https://www.adafruit.com/product/1270)
What's better than a single LED? Lots of LEDs! A fun way to make a numeric display is to use a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). LED matrices like these are 'multiplexed' - so to control all the seven-segment LEDs you need 14 pins....

Out of Stock
[Buy Now](https://www.adafruit.com/product/1270)
[Related Guides to the Product](https://learn.adafruit.com/products/1270/guides)
### Small 1.2" 8x8 Ultra Bright White LED Matrix + Backpack

[Small 1.2" 8x8 Ultra Bright White LED Matrix + Backpack](https://www.adafruit.com/product/1614)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1614)
[Related Guides to the Product](https://learn.adafruit.com/products/1614/guides)
### Adafruit Small 1.2" 8x8 LED Matrix w/I2C Backpack - Pure Green

[Adafruit Small 1.2" 8x8 LED Matrix w/I2C Backpack - Pure Green](https://www.adafruit.com/product/1632)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1632)
[Related Guides to the Product](https://learn.adafruit.com/products/1632/guides)
### Adafruit Mini 0.8" 8x8 LED Matrix w/I2C Backpack - Pure Green

[Adafruit Mini 0.8" 8x8 LED Matrix w/I2C Backpack - Pure Green](https://www.adafruit.com/product/1633)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/1633)
[Related Guides to the Product](https://learn.adafruit.com/products/1633/guides)
### Bi-Color (Red/Green) 24-Bar Bargraph w/I2C Backpack Kit

[Bi-Color (Red/Green) 24-Bar Bargraph w/I2C Backpack Kit](https://www.adafruit.com/product/1721)
What's better than a single LED? Lots of LEDs! A fun way to make a small linear display is to use two 12-bar Bi-color bar-graphs. However, this LED bargraph is 'multiplexed' - so to control all the 48 LEDs you need a lot of pins. <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/1721)
[Related Guides to the Product](https://learn.adafruit.com/products/1721/guides)
### Small 1.2" 8x8 Ultra Bright Square Amber LED Matrix + Backpack

[Small 1.2" 8x8 Ultra Bright Square Amber LED Matrix + Backpack](https://www.adafruit.com/product/1854)
What's better than a single LED? Lots of LEDs! Matrices like these are 'multiplexed' - so to control 64 LEDs you need 16 pins. That's a lot of pins, and there are [driver chips like the MAX7219](//www.adafruit.com/products/453) that can control a matrix for you but...

In Stock
[Buy Now](https://www.adafruit.com/product/1854)
[Related Guides to the Product](https://learn.adafruit.com/products/1854/guides)
### Small 1.2" 8x8 Ultra Bright Square Yellow LED Matrix + Backpack

[Small 1.2" 8x8 Ultra Bright Square Yellow LED Matrix + Backpack](https://www.adafruit.com/product/1855)
What's better than a single LED? Lots of LEDs! Matrices like these are 'multiplexed' - so to control 64 LEDs you need 16 pins. That's a lot of pins, and there are [driver chips like the MAX7219](//www.adafruit.com/products/453) that can control a matrix for you but...

In Stock
[Buy Now](https://www.adafruit.com/product/1855)
[Related Guides to the Product](https://learn.adafruit.com/products/1855/guides)
### Small 1.2" 8x8 Bright Square Pure Green LED Matrix + Backpack

[Small 1.2" 8x8 Bright Square Pure Green LED Matrix + Backpack](https://www.adafruit.com/product/1856)
What's better than a single LED? Lots of LEDs! Matrices like these are 'multiplexed' - so to control 64 LEDs you need 16 pins. That's a lot of pins, and there are [driver chips like the MAX7219](//www.adafruit.com/products/453) that can control a matrix for you but...

In Stock
[Buy Now](https://www.adafruit.com/product/1856)
[Related Guides to the Product](https://learn.adafruit.com/products/1856/guides)
### Small 1.2" 8x8 Ultra Bright Square White LED Matrix + Backpack

[Small 1.2" 8x8 Ultra Bright Square White LED Matrix + Backpack](https://www.adafruit.com/product/1857)
What's better than a single LED? Lots of LEDs! Matrices like these are 'multiplexed' - so to control 64 LEDs you need 16 pins. That's a lot of pins, and there are [driver chips like the MAX7219](//www.adafruit.com/products/453) that can control a matrix for you but...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1857)
[Related Guides to the Product](https://learn.adafruit.com/products/1857/guides)
### Adafruit 14-segment LED Alphanumeric Backpack - STEMMA QT

[Adafruit 14-segment LED Alphanumeric Backpack - STEMMA QT](https://www.adafruit.com/product/1910)
By popular request, you can now get our 14-segment LED backpacks without the LEDs! These backpacks feature an HT16K33 I2C LED driver, they're simple and easy to use - you can use [our very nice library for the backpacks to...](https://github.com/adafruit/Adafruit-LED-Backpack-Library)

In Stock
[Buy Now](https://www.adafruit.com/product/1910)
[Related Guides to the Product](https://learn.adafruit.com/products/1910/guides)
### Quad Alphanumeric Display - Red 0.54" Digits w/ I2C Backpack

[Quad Alphanumeric Display - Red 0.54" Digits w/ I2C Backpack](https://www.adafruit.com/product/1911)
Display, elegantly, 012345678 or 9! Gaze, hypnotized, at ABCDEFGHIJKLM - well it can display the whole alphabet. You get the point. This is a nice, bright alphanumeric display that shows letters and numbers in a beautiful red hue. It's super bright and designed for viewing from distances...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1911)
[Related Guides to the Product](https://learn.adafruit.com/products/1911/guides)
### Quad Alphanumeric Display - Blue 0.54" Digits w/ I2C Backpack

[Quad Alphanumeric Display - Blue 0.54" Digits w/ I2C Backpack](https://www.adafruit.com/product/1912)
Display, elegantly, 012345678 or 9! Gaze, hypnotized, at ABCDEFGHIJKLM - well it can display the whole alphabet. You get the point. This is a nice, bright alphanumeric display that shows letters and numbers in a beautiful blue hue. It's super bright and designed for viewing from distances...

In Stock
[Buy Now](https://www.adafruit.com/product/1912)
[Related Guides to the Product](https://learn.adafruit.com/products/1912/guides)
### 16x8 1.2" LED Matrix + Backpack - Ultra Bright Round Green LEDs

[16x8 1.2" LED Matrix + Backpack - Ultra Bright Round Green LEDs](https://www.adafruit.com/product/2035)
What's better than a single LED? Lots of LEDs! And what's better than lots of LEDs?&nbsp; **TWO TIMES AS MANY LEDS!!!**

With the 16x8 LED Matrix Backpack we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto...

In Stock
[Buy Now](https://www.adafruit.com/product/2035)
[Related Guides to the Product](https://learn.adafruit.com/products/2035/guides)
### 16x8 1.2" LED Matrix+Backpack UltraBright Round YellowGreen LEDs

[16x8 1.2" LED Matrix+Backpack UltraBright Round YellowGreen LEDs](https://www.adafruit.com/product/2036)
What's better than a single LED? Lots of LEDs! And what's better than lots of LEDs?&nbsp; **TWO TIMES AS MANY LEDS!!!**

With the 16x8 LED Matrix Backpack we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto...

In Stock
[Buy Now](https://www.adafruit.com/product/2036)
[Related Guides to the Product](https://learn.adafruit.com/products/2036/guides)
### 16x8 1.2" LED Matrix + Backpack - Ultra Bright Round Red LEDs

[16x8 1.2" LED Matrix + Backpack - Ultra Bright Round Red LEDs](https://www.adafruit.com/product/2037)
What's better than a single LED? Lots of LEDs! And what's better than lots of LEDs?&nbsp; **TWO TIMES AS MANY LEDS!!!**

With the 16x8 LED Matrix Backpack we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto...

In Stock
[Buy Now](https://www.adafruit.com/product/2037)
[Related Guides to the Product](https://learn.adafruit.com/products/2037/guides)
### 16x8 1.2" LED Matrix + Backpack - Ultra Bright Round White LEDs

[16x8 1.2" LED Matrix + Backpack - Ultra Bright Round White LEDs](https://www.adafruit.com/product/2038)
What's better than a single LED? Lots of LEDs! And what's better than lots of LEDs?&nbsp; **TWO TIMES AS MANY LEDS!!!**

With the 16x8 LED Matrix Backpack we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto...

In Stock
[Buy Now](https://www.adafruit.com/product/2038)
[Related Guides to the Product](https://learn.adafruit.com/products/2038/guides)
### 16x8 1.2" LED Matrix + Backpack - Ultra Bright Round Blue LEDs

[16x8 1.2" LED Matrix + Backpack - Ultra Bright Round Blue LEDs](https://www.adafruit.com/product/2039)
What's better than a single LED? Lots of LEDs! And what's better than lots of LEDs?&nbsp; **TWO TIMES AS MANY LEDS!!!**

With the 16x8 LED Matrix Backpack we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto...

In Stock
[Buy Now](https://www.adafruit.com/product/2039)
[Related Guides to the Product](https://learn.adafruit.com/products/2039/guides)
### 16x8 1.2" LED Matrix + Backpack - Ultra Bright Square Blue LEDs

[16x8 1.2" LED Matrix + Backpack - Ultra Bright Square Blue LEDs](https://www.adafruit.com/product/2040)
What's better than a single LED? Lots of LEDs! And what's better than lots of LEDs?&nbsp; **TWO TIMES AS MANY LEDS!!!**

With the 16x8 LED Matrix Backpack we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto...

In Stock
[Buy Now](https://www.adafruit.com/product/2040)
[Related Guides to the Product](https://learn.adafruit.com/products/2040/guides)
### 16x8 1.2" LED Matrix + Backpack - Ultra Bright Square Amber LEDs

[16x8 1.2" LED Matrix + Backpack - Ultra Bright Square Amber LEDs](https://www.adafruit.com/product/2041)
What's better than a single LED? Lots of LEDs! And what's better than lots of LEDs?&nbsp; **TWO TIMES AS MANY LEDS!!!**

With the 16x8 LED Matrix Backpack we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2041)
[Related Guides to the Product](https://learn.adafruit.com/products/2041/guides)
### 16x8 1.2" LED Matrix + Backpack - Ultra Bright Square Green LEDs

[16x8 1.2" LED Matrix + Backpack - Ultra Bright Square Green LEDs](https://www.adafruit.com/product/2042)
What's better than a single LED? Lots of LEDs! And what's better than lots of LEDs?&nbsp; **TWO TIMES AS MANY LEDS!!!**

With the 16x8 LED Matrix Backpack we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto...

In Stock
[Buy Now](https://www.adafruit.com/product/2042)
[Related Guides to the Product](https://learn.adafruit.com/products/2042/guides)
### 16x8 1.2" LED Matrix + Backpack -Ultra Bright Square Yellow LEDs

[16x8 1.2" LED Matrix + Backpack -Ultra Bright Square Yellow LEDs](https://www.adafruit.com/product/2043)
What's better than a single LED? Lots of LEDs! And what's better than lots of LEDs?&nbsp; **TWO TIMES AS MANY LEDS!!!**

With the 16x8 LED Matrix Backpack we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto...

In Stock
[Buy Now](https://www.adafruit.com/product/2043)
[Related Guides to the Product](https://learn.adafruit.com/products/2043/guides)
### 16x8 1.2" LED Matrix + Backpack - Ultra Bright Square White LEDs

[16x8 1.2" LED Matrix + Backpack - Ultra Bright Square White LEDs](https://www.adafruit.com/product/2044)
What's better than a single LED? Lots of LEDs! And what's better than lots of LEDs?&nbsp; **TWO TIMES AS MANY LEDS!!!**

With the 16x8 LED Matrix Backpack we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto...

In Stock
[Buy Now](https://www.adafruit.com/product/2044)
[Related Guides to the Product](https://learn.adafruit.com/products/2044/guides)
### 16x8 1.2" LED Matrix + Backpack-Ultra Bright Round Orange LEDs

[16x8 1.2" LED Matrix + Backpack-Ultra Bright Round Orange LEDs](https://www.adafruit.com/product/2052)
What's better than a single LED? Lots of LEDs! And what's better than lots of LEDs?&nbsp; **TWO TIMES AS MANY LEDS!!!**

With the 16x8 LED Matrix Backpack we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto...

In Stock
[Buy Now](https://www.adafruit.com/product/2052)
[Related Guides to the Product](https://learn.adafruit.com/products/2052/guides)
### 16x8 1.2" LED Matrices+Backpack Round LEDs in Various Colors

[16x8 1.2" LED Matrices+Backpack Round LEDs in Various Colors](https://www.adafruit.com/product/2054)
What's better than a single LED? Lots of LEDs! And what's better than lots of LEDs?&nbsp; **TWO TIMES AS MANY LEDS!!!**

With the 16x8 LED Matrix Backpack we've doubled your project's matrix capacity by making it super easy to get two separate 8x8 matrices onto...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2054)
[Related Guides to the Product](https://learn.adafruit.com/products/2054/guides)
### Adafruit 8x16 LED Matrix FeatherWing w/o Matrices

[Adafruit 8x16 LED Matrix FeatherWing w/o Matrices](https://www.adafruit.com/product/3090)
You will chirp with delight when you see how easy it is to make your very own 8x16 LED matrix display for any Feather. At 0.8" square, the little [8x8 matrices](https://www.adafruit.com/new/?q=8x8%20miniature%20LED%20matrix&) have everything a big LED matrix has,...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3090)
[Related Guides to the Product](https://learn.adafruit.com/products/3090/guides)
### Adafruit 14-segment LED Alphanumeric backpack (same as P1910)

[Adafruit 14-segment LED Alphanumeric backpack (same as P1910)](https://www.adafruit.com/product/3322)
Just the backpack + 4pin header

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/3322)
[Related Guides to the Product](https://learn.adafruit.com/products/3322/guides)

## Featured Products

### Adafruit Small 1.2" 8x8 LED Matrix w/I2C Backpack - Yellow-Green

[Adafruit Small 1.2" 8x8 LED Matrix w/I2C Backpack - Yellow-Green](https://www.adafruit.com/product/1051)
What's better than a single LED? Lots of LEDs! A fun way to make a small display is to use an [8x8 matrix](https://www.adafruit.com/category/37_88) or a [4-digit 7-segment display](https://www.adafruit.com/category/37_103). Matrices like these are...

In Stock
[Buy Now](https://www.adafruit.com/product/1051)
[Related Guides to the Product](https://learn.adafruit.com/products/1051/guides)
### Small 1.2" 8x8 Ultra Bright Square Blue LED Matrix + Backpack

[Small 1.2" 8x8 Ultra Bright Square Blue LED Matrix + Backpack](https://www.adafruit.com/product/1853)
What's better than a single LED? Lots of LEDs! Matrices like these are 'multiplexed' - so to control 64 LEDs you need 16 pins. That's a lot of pins, and there are [driver chips like the MAX7219](//www.adafruit.com/products/453) that can control a matrix for you but...

In Stock
[Buy Now](https://www.adafruit.com/product/1853)
[Related Guides to the Product](https://learn.adafruit.com/products/1853/guides)

## Related Guides

- [T³ Time Triangle Thing](https://learn.adafruit.com/t-time-triangle-thing.md)
- [Circle of Fifths Euclidean Synth with synthio and CircuitPython](https://learn.adafruit.com/circle-of-fifths-euclidean-synth-with-synthio-and-circuitpython.md)
- [CircuitPython Hardware: LED Backpacks & FeatherWings](https://learn.adafruit.com/micropython-hardware-led-backpacks-and-featherwings.md)
- [LED Backpack Displays on Raspberry Pi and BeagleBone Black](https://learn.adafruit.com/led-backpack-displays-on-raspberry-pi-and-beaglebone-black.md)
- [DIY Pocket LED Gamer - Tiny Tetris!](https://learn.adafruit.com/diy-3d-printed-handheld-pocket-game-tiny-tetris-snake.md)
- [Raspberry Pi Physical Dashboard](https://learn.adafruit.com/raspberry-pi-physical-dashboard.md)
- [Tap Tempo Trinket](https://learn.adafruit.com/tap-tempo-trinket.md)
- [Trinket-Powered Conference Room Occupancy Display](https://learn.adafruit.com/trinket-powered-room-conference-occupancy-display.md)
- [Personalized NextBus ESP8266 Transit Clock](https://learn.adafruit.com/personalized-esp8266-transit-clock.md)
- [Arduino GPS Clock](https://learn.adafruit.com/arduino-clock.md)
- [Adafruit FT232H With SPI & I2C Devices](https://learn.adafruit.com/adafruit-ft232h-with-spi-and-i2c-libraries.md)
- [Animating Multiple LED Backpacks](https://learn.adafruit.com/animating-multiple-led-backpacks.md)
- [Adafruit MatrixPortal M4](https://learn.adafruit.com/adafruit-matrixportal-m4.md)
- [RGB Matrix Dreidel Game](https://learn.adafruit.com/rgb-matrix-dreidel-game.md)
- [Matrix Portal New Guide Scroller](https://learn.adafruit.com/matrix-portal-new-guide-scroller.md)
