# Bluetooth-Controlled Matrix LED Sign using Bluefruit Connect

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/126/847/medium800thumb/adafruit_products_ezgif.com-optimize-15.jpg?1704300869)

Express yourself with this Bluetooth-controlled sign using Adafruit's RGB LED Matrix Display, Adafruit nRF52840 Feather running CircuitPython, and the RGB Matrix nRF52840 FeatherWing.

With this project, you can effortlessly display text on the Matrix panel and change the text color with ease through the Bluefruit Connect app.&nbsp;You can display scrolling text on the Matrix display and easily change the color of the text using the Bluefruit Connect app.

This setup was initially written for the 64x32 Matrix, but has also been tested on the [64x64 Matrix](https://www.adafruit.com/?q=64x64+RGB+LED+matrix&sort=BestMatch), [16x32 Matrix](https://www.adafruit.com/product/420) and [32x32 Matrix](https://www.adafruit.com/?q=32x32+RGB+LED+MAtrix&sort=BestMatch) as well.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/845/medium800/adafruit_products_IMG_2828_2.png?1704216538)

Info: 

## Parts
Featured
### Adafruit RGB Matrix FeatherWing Kit - For nRF52840 Feathers

[Adafruit RGB Matrix FeatherWing Kit - For nRF52840 Feathers](https://www.adafruit.com/product/4702)
Ahoy! It's time to create a dazzling light up project with our new **RGB Matrix FeatherWing for nRF52840**. Now you can quickly and easily create projects featuring your favorite 16 or 32-pixel tall matrix boards. Using our RGB Matrix library...

In Stock
[Buy Now](https://www.adafruit.com/product/4702)
[Related Guides to the Product](https://learn.adafruit.com/products/4702/guides)
![White woman wearing blue gloved rotating an RGB LED matrix. The LED animation resembles falling colored sand.](https://cdn-shop.adafruit.com/product-videos/640x480/4702-09.jpg)

Featured
### Adafruit Feather nRF52840 Express

[Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)
The **Adafruit Feather nRF52840 Express** is the new Feather family member with Bluetooth® Low Energy and _native USB support_ featuring the nRF52840!&nbsp; It's our take on an 'all-in-one' Arduino-compatible + Bluetooth® Low Energy with built-in USB...

In Stock
[Buy Now](https://www.adafruit.com/product/4062)
[Related Guides to the Product](https://learn.adafruit.com/products/4062/guides)
![Angled shot of a Adafruit Feather nRF52840 Express. ](https://cdn-shop.adafruit.com/640x480/4062-02.jpg)

Featured
### 64x32 RGB LED Matrix - 4mm pitch

[64x32 RGB LED Matrix - 4mm pitch](https://www.adafruit.com/product/2278)
Bring a little bit of Times Square into your home with this sweet 64 x 32 square RGB LED matrix panel. These panels are normally used to make video walls, here in New York we see them on the sides of busses and bus stops, to display animations or short video clips. We thought they looked...

In Stock
[Buy Now](https://www.adafruit.com/product/2278)
[Related Guides to the Product](https://learn.adafruit.com/products/2278/guides)
![Two white hands hold out an assembled and powered on 64x32 RGB LED Matrix Panel - 4mm pitch. The matrix displays "Adafruit Industries LED MATRIX! 32x64 *RGB*"](https://cdn-shop.adafruit.com/640x480/2278-00.jpg)

Featured
### Header Kit for Feather - 12-pin and 16-pin Female Header Set

[Header Kit for Feather - 12-pin and 16-pin Female Header Set](https://www.adafruit.com/product/2886)
These two&nbsp; **Female&nbsp;Headers** &nbsp;alone are, well, lonely. But pair them with any of our&nbsp;[Feather](https://www.adafruit.com/categories/777)&nbsp;boards and you're in business!

What do they do? They get soldered on either side of the Feather...

In Stock
[Buy Now](https://www.adafruit.com/product/2886)
[Related Guides to the Product](https://learn.adafruit.com/products/2886/guides)
![Angled shot of a Header Kit for Feather - 12-pin and 16-pin Female Header Set. ](https://cdn-shop.adafruit.com/640x480/2886-00.jpg)

Featured
### 5V 2A (2000mA) switching power supply - UL Listed

[5V 2A (2000mA) switching power supply - UL Listed](https://www.adafruit.com/product/276)
This is an FCC/CE certified and UL listed power supply. Need a lot of 5V power? This switching supply gives a clean regulated 5V output at up to 2000mA. 110 or 240 input, so it works in any country. The plugs are "US 2-prong" style so you may need a plug adapter, but you can pick one...

In Stock
[Buy Now](https://www.adafruit.com/product/276)
[Related Guides to the Product](https://learn.adafruit.com/products/276/guides)
![Angled shot of power supply.](https://cdn-shop.adafruit.com/640x480/276-06.jpg)

Featured
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
![USB cable - USB A to Micro-B - 3 foot long](https://cdn-shop.adafruit.com/640x480/592-01.jpg)

# Bluetooth-Controlled Matrix LED Sign using Bluefruit Connect

## CircuitPython for Feather nRF52840

[CircuitPython](https://github.com/adafruit/circuitpython) is a derivative of [MicroPython](https://micropython.org) designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. Simply copy and edit files on the **CIRCUITPY** drive to iterate.

The following instructions will show you how to install CircuitPython. If you've already installed CircuitPython but are looking to update it or reinstall it, the same steps work for that as well!

## Set up CircuitPython Quick Start!

Follow this quick step-by-step for super-fast Python power :)

[Download the latest version of CircuitPython for this board via CircuitPython.org](https://circuitpython.org/board/feather_nrf52840_express/)
 **Click the link above to download the latest UF2 file.**

&nbsp;

Download and save it to your desktop (or wherever is handy).

![circuitpython_nRF52840_UF2.png](https://cdn-learn.adafruit.com/assets/assets/000/070/318/medium640/circuitpython_nRF52840_UF2.png?1548963877)

Plug your Feather nRF52840 into your computer using a known-good USB cable.

**A lot of people end up using charge-only USB cables and it is very frustrating! So make sure you have a USB cable you know is good for data sync.**

Double-click the **Reset** button next to the USB connector on your board, and you will see the NeoPixel RGB LED turn green (identified by the arrow in the image). If it turns red, check the USB cable, try another USB port, etc. **Note:** The little red LED next to the USB connector will pulse red. That's ok!

If double-clicking doesn't work the first time, try again. Sometimes it can take a few tries to get the rhythm right!

![circuitpython_FeathernRF52840_Top_Product_Image.jpg](https://cdn-learn.adafruit.com/assets/assets/000/070/319/medium640/circuitpython_FeathernRF52840_Top_Product_Image.jpg?1548963972)

You will see a new disk drive appear called **FTHR840BOOT**.

&nbsp;

&nbsp;

&nbsp;

Drag the **adafruit\_circuitpython\_etc.uf2** file to **FTHR840BOOT****.**

![circuitpython_FTHR840BOOT.png](https://cdn-learn.adafruit.com/assets/assets/000/070/320/medium640/circuitpython_FTHR840BOOT.png?1548964488)

![circuitpython_Drag_nRF52840_UF2.png](https://cdn-learn.adafruit.com/assets/assets/000/070/321/medium640/circuitpython_Drag_nRF52840_UF2.png?1548964497)

The LED will flash. Then, the&nbsp; **FTHR840BOOT** drive will disappear and a new disk drive called **CIRCUITPY** will appear.

&nbsp;

That's it, you're done! :)

![circuitpython_nRF52840_CIRCUITPY.png](https://cdn-learn.adafruit.com/assets/assets/000/070/322/medium640/circuitpython_nRF52840_CIRCUITPY.png?1548964511)

# Bluetooth-Controlled Matrix LED Sign using Bluefruit Connect

## Update Bootloader

Warning: 

Older versions of Adafruit's nRF52840 boards were shipped with a bootloader that does not handle large UF2's, including CircuitPython 8.2.0 and later, and has other issues. To check whether you need to update the bootloader, double-click the reset button, and look in the `...BOOT` drive for **INFO\_UF2.TXT**.

Inside that file, check the version number of the bootloader. There are multiple version numbers. Look for the number just after "UF2 Bootloader" on the first line. See the picture below **It should be 0.6.1 or newer**.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/812/medium800/circuitpython_nrf52-bootloader-version-number.png?1714684011)

The Adafruit nRF52 Bootloader can be upgraded/downgraded without any additional hardware. There are 3 different ways to update the bootloader, each has its pros and cons:

Warning: You **cannot** use the UF2 updater if your existing bootloader is version 0.3.x or earlier. You must use Arduino IDE or the Command Line.

- **Use UF2:&nbsp;** This is the fastest and safest way to update bootloader. However, it requires your existing bootloader version is at least **0.4.0&nbsp;** and only work with nRF52840 (not nRF52832).
- **Use Arduino IDE** : work with all Adafruit nRF52 boards and bootloader version, typo free but may not be the latest bootloader version due to the BSP release cycle.
- **Use Command Line** : work with all boards and bootloader version (including 3rd party one). This command line uses the back-end of the Arduino IDE method above.&nbsp;

# Bluetooth-Controlled Matrix LED Sign using Bluefruit Connect

## Use UF2

This is the fastest and safest way to update bootloader. However, it requires your existing bootloader is at least **0.4.0&nbsp;** and only work with nRF52840 (not nRF52832) since UF2 make use of USB MSC interface.

Danger: You **cannot** use the UF2 updater if your existing bootloader is version 0.3.x or earlier. You must use Arduino IDE or the Command Line.

## Download update-bootloader UF2

You need a .`uf2` file containing the latest version of the bootloader. The most common updaters are linked below. For updaters for other boards, look for the [.uf2 files here](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest) that begin with **update-...**

Info: Note if you click the link above, you must scroll down to the UF2 files that begin with the word update as the zip files do not include UF2s. Most users will click the appropriate green button below to select the file for their board.

[Feather nRF52840 Express bootloader updater UF2](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest/update-feather_nrf52840_express_bootloader-*_nosd.uf2)
[Circuit Playground Bluefruit bootloader updater UF2](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest/update-circuitplayground_nrf52840_bootloader-*_nosd.uf2)
[ItsyBitsy nRF52840 bootloader updater UF2](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest/update-itsybitsy_nrf52840_express_bootloader-*_nosd.uf2)
[CLUE nRF52840 bootloader updater UF2](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest/update-clue_nrf52840_bootloader-*_nosd.uf2)
[Feather Sense nRF52840 bootloader updater UF2](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest/update-feather_nrf52840_sense_bootloader-*_nosd.uf2)
## Enter Bootloader Mode

Double-click the&nbsp; **Reset&nbsp;** button on your board, and you will see the NeoPixel RGB LED turn green (identified by the arrow in the image). If it turns red, check the USB cable, try another USB port, etc.

**Note:** on **nRF52840 USB Key with TinyUF2 (PID 5199)** you need to hold its button while plugging into your PC.

## Drag & Drop UF2

You will see a new **BOOT** disk drive appear e.g **FTHR840BOOT**. Drag the downloaded **.** `uf2`&nbsp;file to **FTHR840BOOT.&nbsp;** The LED will flash. Then, the&nbsp; **FTHR840BOOT** drive will disappear. That's it, you have successfully update your board to the latest version.&nbsp;&nbsp;&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/107/816/medium800/circuitpython_update_bootloader_uf2.png?1642140755)

## Issues

If you download the wrong UF2 file for your board, dragging the file to the **...BOOT** drive will close the drive but will not update the firmware (as it is the firmware for the wrong board). You can check the **INFO\_UF2.TXT** on the board and see if the firmware was updated (likely with the wrong UF2 file it was not).&nbsp;

If you cannot find the correct UF2 check all the files in [https://github.com/adafruit/Adafruit\_nRF52\_Bootloader/releases](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases) for the correct UF2 (they all start with the word `update-boardname-bootloader-version.uf2` so scroll the list down to the files starting with u.

Non Adafruit board firmware updates can be found using this method also.

# Bluetooth-Controlled Matrix LED Sign using Bluefruit Connect

## Use Arduino IDE

Arduino IDE **Burn Bootloader** menu option will pick the correct bootloader binary for your selected board and prevent any command typos or other common errors.

Danger: 

Info: 

Pink: If you have previously installed CircuitPython on the board, double click the reset button prior to flashing the firmware to put it in bootloader mode.

If you have not already done so, set up Arduino IDE for nRF52, using the instructions in [Arduino Support Setup](https://learn.adafruit.com/adafruit-circuit-playground-bluefruit/arduino-support-setup).

Make sure no other program is attached to the serial port on the board, such as Mu, the Serial Monitor in Arduino, or a terminal program. Then, to start, select the correct board you are using under **Tools -\> Board**

![](https://cdn-learn.adafruit.com/assets/assets/000/107/810/medium800/circuitpython_update_bootloader_arduino.png?1642132225)

Then select " **Bootloader DFU for Bluefruit nRF52**" for **Tools-\>Programmer**

![](https://cdn-learn.adafruit.com/assets/assets/000/107/814/medium800/circuitpython_update_bootloader_arduino_2.png?1642132445)

 **Double check all of the following: Board, Programmer...**

Then select **Tools-\>Burn Bootloader** to start the upgrade.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/815/medium800/circuitpython_update_bootloader_arduino_3.png?1642132501)

After receiving the new Bootloader over the serial connection, the old Bootloader will erase itself! The new bootloader will then be flashed. The process typically takes 30-60 seconds to complete. Make sure you see the " **Device programmed**" in the output log before launching Serial monitor or uploadinga new sketch.

```terminal
Upgrading target on /dev/ttyACM0 with DFU package /Adafruit_nRF52_Arduino/bootloader/feather_nrf52840_express/feather_nrf52840_express_bootloader-0.6.2_s140_6.1.1.zip. Flow control is disabled, Dual bank, Touch 1200
Touched serial port /dev/ttyACM0
Opened serial port /dev/ttyACM0
Starting DFU upgrade of type 3, SoftDevice size: 151016, bootloader size: 39000, application size: 0
Sending DFU start packet
Sending DFU init packet
Sending firmware file
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
############
Activating new firmware

DFU upgrade took 20.50154972076416s
Device programmed.
```

Drawbacks of this method are that you will need to install the Arduino IDE, and the bundled bootloader may not be the latest one. Check out the next page for a more advanced command line version.

# Bluetooth-Controlled Matrix LED Sign using Bluefruit Connect

## Use Command Line

Info: 

## Download Bootloader Package

To update the bootloader you need a **.zip** file containing the latest version of the bootloader. The most common bootloader **.zip** files are linked below. For **.zip** files for other boards, look for the [.zip files here](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest) that begin with the name of the board you want to update.

Info: Pick the download below for the board that you have. If you have a different board, look for the right .zip file for the board you have at the link just above.

[Bootloader .zip package for Adafruit Feather nRF52840 (latest version)](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest/feather_nrf52840_express_bootloader-*.zip)
[Bootloader .zip package for Adafruit Feather nRF52840 Sense (latest version)](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest/feather_nrf52840_sense_bootloader-*.zip)
[Bootloader .zip package for Adafruit CLUE (latest version)](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest/clue_nrf52840_bootloader-*.zip)
[Bootloader .zip package for Circuit Playground Bluefruit (latest version)](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest/circuitplayground_nrf52840_bootloader-*.zip)
[Bootloader .zip package for Adafruit ItsyBitsy nRF52840 (latest version)](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest/itsybitsy_nrf52840_express_bootloader-*.zip)
Warning: 

## Download **adafruit-nrfutil**

You will also need the utility program **adafruit-nrfutil,** which has slightly different names on different platforms.

### **adafruit-nrfutil** for Linux

On Linux, you can download and install **adafruit-nrfutil** &nbsp;by doing:

```terminal
pip3 install adafruit-nrfutil
```

### **adafruit-nrfutil** for macOS

On macOS, if you have **python3** and **pip3** installed, you can install via **pip3** , as above for Linux. Otherwise download the zip file **adafruit-nrfutil-macos...zip** from the link below, and then extract the file&nbsp; **adafruit-nrfutil** from the zip file.

[adafruit-nrfutil-macos for MacOS (in .zip file)](https://github.com/adafruit/Adafruit_nRF52_nrfutil/releases/latest/adafruit-nrfutil-*-macos.zip)
Then make **adafruit-nrfutil** &nbsp;executable by doing:

```terminal
chmod +x adafruit-nrfutil
```

### **adafruit-nrfutil** for Windows

Download the .zip file&nbsp;from this link, and extract the file **adafruit-nrfutil.exe**.

[adafruit-nrfutil.exe for Windows (in .zip file)](https://github.com/adafruit/Adafruit_nRF52_nrfutil/releases/latest/adafruit-nrfutil-*-win.zip)
## Update Bootloader

To update the bootloader, first connect the board, and then double-click the RESET button to get the ... **BOOT** drive to appear.

Info: 

### Updating on Linux

Run a command similar to the one below in a shell window. **Substitute the name of the .zip file you downloaded above for the file given below**.

```terminal
adafruit-nrfutil --verbose dfu serial --package feather_nrf52840_express_bootloader-0.8.0_s140_6.1.1.zip -p /dev/ttyACM0 -b 115200 --singlebank --touch 1200
```

### Updating on macOS

Find out the device name for the connected board, by doing:

```terminal
ls /dev/cu.*
```

The device name will be something like `/dev/cu.usbmodem411`. Use this command, substituting the device name you've discovered. **Substitute the name of the .zip file you downloaded above for the file given below**. and the name of the .zip package you downloaded above. If you are running it other than where you downloaded **adafruit-nrfutil-macos** , change the path to the command accordingly. If you installed it via pip3, it's just called **adafruit-nrfutil** , and it should be in your `PATH`.

```terminal
./adafruit-nrfutil-macos --verbose dfu serial --package feather_nrf52840_express_bootloader-0.8.0_s140_6.1.1.zip -p /dev/cu.usbmodem411 -b 115200 --singlebank --touch 1200
```

### Updating on Windows

Use this command in the folder where you downloaded the other two files above. You'll need to specify the correct COM port, instead of `COMxx`. Look in **Device Manager-\>Ports** for the name of the COM port (it will be listed as a "USB Serial Device" on Windows 10) after you have double-clicked the RESET button. **Substitute the name of the .zip file you downloaded above for the file given below**.

```terminal
adafruit-nrfutil.exe --verbose dfu serial --package feather_nrf52840_express_bootloader-0.8.0_s140_6.1.1.zip --port COMxx -b 115200 --singlebank --touch 1200
```

### Output when Updating

When you run the **adafruit-nrfutil** program, you will see output similar to this (it will vary slightly depending on your OS).

```terminal
Upgrading target on COM29 with DFU package C:\Users\halbe\Desktop\update-feather-nrf52840-bootloader-0.8.0-windows\feather_nrf52840_express_bootloader-0.8.0_s140_6.1.1.zip. Flow control is disabled, Single bank, Touch 1200
Touched serial port COM29
Opened serial port COM29
Starting DFU upgrade of type 3, SoftDevice size: 151016, bootloader size: 39000, application size: 0
Sending DFU start packet
Sending DFU init packet
Sending firmware file
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
############
Activating new firmware

DFU upgrade took 21.119003295898438s
Device programmed.
```

Once done, click the RESET button again - the bootloader will be running!

# Bluetooth-Controlled Matrix LED Sign using Bluefruit Connect

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/126/848/medium800/adafruit_products_IMG_001.png?1704303927)

Assembling your Bluetooth sign with the RGB LED Matrix Panel is straightforward but will require some soldering.

In addition to your Adafruit RGB Matrix FeatherWing Kit, you'll also need a Header Kit for Feather - 12-pin and 16-pin Socket Header Set.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/856/medium800/adafruit_products_2886-00.jpg?1704306139)

First, you'll need to solder two socket headers to each side of the RGB Matrix nRF52840 FeatherWing.

![adafruit_products_IMG_0002.png](https://cdn-learn.adafruit.com/assets/assets/000/126/849/medium640/adafruit_products_IMG_0002.png?1704304257)

![adafruit_products_IMG_0003.png](https://cdn-learn.adafruit.com/assets/assets/000/126/850/medium640/adafruit_products_IMG_0003.png?1704304276)

Next solder the 2x8 IDC header on to the back of the feather.

![adafruit_products_IMG_0004.png](https://cdn-learn.adafruit.com/assets/assets/000/126/851/medium640/adafruit_products_IMG_0004.png?1704304675)

![adafruit_products_IMG_0004.png](https://cdn-learn.adafruit.com/assets/assets/000/126/852/medium640/adafruit_products_IMG_0004.png?1704304701)

Finally, you'll need to solder the 5.08mm terminal block and the 2.1mm DC jack to the feather.

![adafruit_products_IMG_0006.png](https://cdn-learn.adafruit.com/assets/assets/000/126/853/medium640/adafruit_products_IMG_0006.png?1704305269)

![adafruit_products_IMG_0007.png](https://cdn-learn.adafruit.com/assets/assets/000/126/854/medium640/adafruit_products_IMG_0007.png?1704305298)

Attach the jumper wires included in the Matrix Panel kit to the terminal block on your Feather board. Remember, the negative sign denotes ground (black wire), while the positive sign is for the 5 volt (red wire).

![adafruit_products_IMG_0008.png](https://cdn-learn.adafruit.com/assets/assets/000/126/857/medium640/adafruit_products_IMG_0008.png?1704308810)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/858/medium800/adafruit_products_IMG_0009.png?1704309140)

Stack your Adafruit nRF52840 Feather Express onto your RGB Matrix nRF52840 FeatherWing to match the photo above.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/126/859/medium800/adafruit_products_IMG_0010.png?1704309984)

Next, connect your RGB Matrix nRF52840 FeatherWing to your Matrix panel. Be sure to place your FeatherWing on the LiPo battery socket on the left side. For the correct orientation, **the arrows on the Matrix panel should point to your right and upward.**

**Finally, connect your&nbsp;** 5V 2A (2000mA) switching power supply to your RGB Matrix nRF52840 Feather Wing's **2.1mm DC jack.&nbsp;**

Great! Now, now to get the Bluefruit Connect app.

# Bluetooth-Controlled Matrix LED Sign using Bluefruit Connect

## Bluefruit Connect App

![](https://cdn-learn.adafruit.com/assets/assets/000/126/860/medium800/adafruit_products_unnamed.png?1704310473)

Use Bluefruit Connect to display text to our Matrix Panel via Bluetooth.

The Bluefruit Connect app allows you to wirelessly connect your iOS or Android device to Adafruit Bluefruit LE modules for control & communication with your projects. First we'll need to download it.

# Bluetooth-Controlled Matrix LED Sign using Bluefruit Connect

## Installation and Setup

![](https://cdn-learn.adafruit.com/assets/assets/000/096/132/medium800/projects_main_thumbnail.jpg?1603190514)

The Bluefruit LE Connect app provides&nbsp;iOS & Android devices with a variety of tools to&nbsp;communicate with Bluefruit LE devices. These tools cover&nbsp;basic communication and info reporting as well as more project specific uses such as Arduino Pin Control and a Color Picker.

The iOS app is a [free download from Apple's App Store](https://itunes.apple.com/us/app/adafruit-bluefruit-le-connect/id830125974?mt=8 "Bluefruit LE Connect"). It requires iOS 11.3 or later and works on iPhones, iPads, and iPod Touches.

The Android app is a free download from the [Google Play Store](https://play.google.com/store/apps/details?id=com.adafruit.bluefruit.le.connect). It requires Android 4.4 or later.

The app is compatible with these BLE devices from Adafruit, and possibly more:

- [Bluefruit LE nRF8001 Breakout](https://www.adafruit.com/products/1697)
- [Bluefruit LE Friend](https://www.adafruit.com/products/2267)
- [Flora Wearable Bluefruit LE Module](https://www.adafruit.com/products/2487)
- [Adafruit Bluefruit LE SPI Friend](https://www.adafruit.com/products/2633)
- [Adafruit Bluefruit LE Micro](https://www.adafruit.com/products/2661)
- [Adafruit Feather 32u4 Bluefruit LE](https://www.adafruit.com/product/2829)
- [Adafruit Feather M0 Bluefruit LE](https://www.adafruit.com/product/2995)
- [Adafruit Feather nRF52 Bluefruit LE - nRF52832](https://www.adafruit.com/product/3406)
- [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)
- [Adafruit CLUE](https://learn.adafruit.com/adafruit-clue)

First off - install the app from one of the App stores listed above if you haven't already.

# Enable Bluetooth
If&nbsp;Bluetooth is disabled on your device, enable it by going to&nbsp; **Settings-\>Bluetooth** on your iOS device, or the analogous setting on your Android device.

![](https://cdn-learn.adafruit.com/assets/assets/000/023/178/medium800/projects_settings-bluetooth-2up.jpg?1423987757)

# Enable Location Services
If you plan to use the app to send location/GPS data to Bluefruit LE, enable Location Services. Enable it on iOS using&nbsp; **Settings-\>Privacy-\>Location Services**.

![](https://cdn-learn.adafruit.com/assets/assets/000/023/179/medium800/projects_settings-locationA-2up.jpg?1423988243)

# Bluetooth-Controlled Matrix LED Sign using Bluefruit Connect

## Scan for Devices

On launch, the app will automatically begin to scan for nearby&nbsp;Bluetooth LE devices. &nbsp;Devices are presented in a table view&nbsp;in the order in which they were discovered.

Danger: 

# iPhone

The following images depict the app when used on the iPhone. The Android app looks similar.

![](https://cdn-learn.adafruit.com/assets/assets/000/071/013/medium800/projects_bluefuit-connect-central-list_half.png?1549903007)

The device list will display all BLE devices discovered by the app (not just Bluefruit hardware) - so you may see a quite a few "" or \<Unknown\> entries for devices that don't advertise their name, as seen above.

- To refresh the list and start a new scan, simply swipe down on the current list.
- Each device's signal strength is displayed in the left side of its row.

If you tap on the device entry (not on Connect), you'll see more detail about a particular device:

![](https://cdn-learn.adafruit.com/assets/assets/000/071/014/medium800/projects_bluefruit-connect-central-list-detail_half.png?1549903096)

# iPad

The following images depict the app when used on the iPad

![](https://cdn-learn.adafruit.com/assets/assets/000/071/015/medium800/projects_bluefruit-connect-ipad-central-list_quarter.png?1549903717)

Tap the middle of a device's table row to reveal its relevant advertisement data.

- Any device listed with a "Connect" button at the right can be accessed in Info mode.
- Any device listed as "UART Capable" can be used with all modes - Info, UART, Pin I/O, & Controller.

Info: 

## Multiple UART Mode
![](https://cdn-learn.adafruit.com/assets/assets/000/096/131/medium800/projects_multi_UART.png?1603190366)

The Multiple UART feature allows to monitor incoming data from, and send data to multiple devices simultaneously.

To use it:

- Activate the **Multiple UART Mode switch**
- Tap **Connect** next to each device you'd like to include
- Tap the Start button below the Multiple UART mode to begin.

Once connected, you can choose **UART** or **Plotter** module to view incoming data from all connected peripherals. In the UART module, you can send data to one or all connected devices at once.

# Connect
Tap the Connect button on the&nbsp;UART capable list&nbsp;entry you wish to use and choose a connection mode from the menu that appears.

![](https://cdn-learn.adafruit.com/assets/assets/000/070/323/medium800/projects_bleconnect-redux1.jpg?1548966544)

# Troubleshooting
![](https://cdn-learn.adafruit.com/assets/assets/000/070/327/medium800/projects_bleconnect-redux4.jpg?1548967824)

If you’re having trouble finding your **Bluefruit** device in the **scanned peripherals list** , ensure the board is **powered** and **not paired** with any other BLE devices. If the problem persists, it could be due to **caching issues** in the iOS or Android operating system. For a fix, try the following:

- **Cycle Bluetooth** - Turn your mobile device’s Bluetooth radio off and on again in the Settings app.
- **Relaunch App** - Quit the Bluetooth LE Connect app and restart it. (instructions for&nbsp;[iOS](https://support.apple.com/en-us/HT201330) & [Android](https://www.wikihow.tech/Force-Quit-Apps-on-Android))
- **Cycle Power** - Restart your mobile device by powering it off and restarting.

Doing one or both of the above solves most peripheral scanning issues. If you're still having trouble, try searching the [Adafruit Support forum](https://forums.adafruit.com/index.php?) for your issue.

# Bluetooth-Controlled Matrix LED Sign using Bluefruit Connect

## Code the Matrix Sign

Once you've finished setting up your Adafruit nRF52840 Feather with CircuitPython, you can access the code and necessary libraries by downloading the Project Bundle.

To do this, click the **&nbsp;Download Project Bundle** &nbsp;button in the window below. It will download all needed files as a zipped folder.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Matrix_Bluetooth_Controlled_LED_Sign/code.py

## Text Editor

Adafruit recommends using the Mu editor for editing your CircuitPython code. You can get more info in&nbsp;[this guide](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor).

Alternatively, you can use any text editor that saves simple text files.

## Upload the Code and Libraries to the Adafruit nRF52840 Feather
After downloading the Project Bundle, plug your Adafruit nRF52840 Express into the computer's USB port. You should see a new flash drive in the computer's File Explorer or Finder (depending on your operating system) called&nbsp; **CIRCUITPY**. Unzip the folder and copy the following items to the Adafruit nRF52840 Express's&nbsp; **CIRCUITPY** &nbsp;drive.&nbsp;

- **lib** &nbsp;folder
- **code.py**

Your Adafruit nRF52840 Express&nbsp; **CIRCUITPY&nbsp;** drive should look like this after copying the **lib** folders and the **code.py** file.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/861/medium800/adafruit_products_Screenshot_2024-01-03_at_3.23.53_PM.png?1704313528)

## code.py Review

### Initialization and Configuration
```python
SEND_RATE = 10  
count = 0
SCROLL_DELAY = 0.05
ble = BLERadio()
uart_server = UARTService()
advertisement = ProvideServicesAdvertisement(uart_server)
```

- **END\_RATE** : Sets how frequently the program sends text over Bluetooth (every 10 seconds).
- **count** : A variable initialized to 0, likely used for counting something (such as messages sent).
- **SCROLL\_DELAY** : Time delay between each scroll movement on the display, set to 0.05 seconds.
- **Bluetooth Setup** : Initializes a BLE (Bluetooth Low Energy) radio, a UART service for Bluetooth communication, and an advertisement for that service.

### Display Setup
```python
displayio.release_displays()

matrix = rgbmatrix.RGBMatrix(
    width=64, height=32, bit_depth=1,
    rgb_pins=[board.D6, board.A5, board.A1, board.A0, board.A4, board.D11],
    addr_pins=[board.D10, board.D5, board.D13, board.D9],
    clock_pin=board.D12, latch_pin=board.RX, output_enable_pin=board.TX,
)
display = framebufferio.FramebufferDisplay(matrix, auto_refresh=True)

main_group = displayio.Group()
```

- **Display Release** : Releases any previously allocated displays to avoid conflicts.
- **Matrix Initialization** : Sets up the RGB matrix display with specific configurations (size, pins, etc.).
- **Display Initialization** : Creates a framebuffer display from the RGB matrix.
- **Display Group** : Initializes a `Group` object, a container for display elements.

### Function Definitions
```python
def scroll(line):
    line.x -= 1
    line_width = line.bounding_box[2]
    if line.x < -line_width:
        line.x = display.width

def update_display(text, color=0xFFFFFF):
    if len(main_group) > 0:
        main_group.pop()
    text_area = label.Label(terminalio.FONT, text=text, color=color)
    text_area.x = display.width
    text_area.y = 13
    main_group.append(text_area)
    display.root_group = main_group
```

- `scroll()` **Function** : Defines how to scroll text across the display. It moves the text to the left and wraps around it when it reaches the edge.
- `update_display()` **Function** : Updates the display with new text. It removes the old text (if any) and adds new text to the display group.

### The Main Loop
```python
while True:
    print("WAITING...")
    update_display("WAITING...")
    ble.start_advertising(advertisement)

    while not ble.connected:
        scroll(main_group[0])
        display.refresh(minimum_frames_per_second=0)
        time.sleep(SCROLL_DELAY)

    # Connected
    ble.stop_advertising()
    print("CONNECTED")
    update_display("CONNECTED")

    # Loop and read packets
    last_send = time.monotonic()
    while ble.connected:
        if uart_server.in_waiting:
            raw_bytes = uart_server.read(uart_server.in_waiting)
            received_text = raw_bytes.decode().strip()
            print("RX:", received_text)
            update_display(received_text, color=0x26B7FF)

        if time.monotonic() - last_send > SEND_RATE:
            transmit_text = "COUNT = {}".format(count)
            print("TX:", transmit_text)
            uart_server.write((transmit_text + "\r\n").encode())
            count += 1
            last_send = time.monotonic()

        scroll(main_group[0])
        display.refresh(minimum_frames_per_second=0)
        time.sleep(SCROLL_DELAY)

    print("DISCONNECTED")
```

- **Outer While Loop** : The main loop that runs forever.
- **Waiting for Connection** : The display shows "WAITING..." and starts advertising for a Bluetooth connection.
- **Scrolling Text** : Continuously scrolls text on the display while not connected.
- **BLE Connection Established** : Stops advertising once connected and updates the display.
- **Inner While Loop** : While connected, it reads data from the UART service, displays it, and sends back a count message at regular intervals defined by `SEND_RATE`.
- **Scrolling and Refreshing Display** : Continuously updates the display while connected.
- **Disconnect Handling** : Prints "DISCONNECTED" to the console when the connection is lost.

# Bluetooth-Controlled Matrix LED Sign using Bluefruit Connect

## Usage

![](https://cdn-learn.adafruit.com/assets/assets/000/126/862/medium800thumb/adafruit_products_ezgif.com-optimize-16.jpg?1704318151)

It's time to display text on the Matrix panel with the code uploaded to your Adafruit nRF52840. Start by opening the Bluefruit Connect app if you don't already have it open.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/863/medium800/adafruit_products_IMG_6EA315960C7E-1.jpeg?1704318955)

From there, select the UART terminal module in the features list. Once in the UART terminal, you can just add whatever text you want to display.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/864/medium800/adafruit_products_IMG_4308.png?1704319336)

Get creative!&nbsp;


## Guide Products

### Adafruit RGB Matrix FeatherWing Kit - For nRF52840 Feathers

[Adafruit RGB Matrix FeatherWing Kit - For nRF52840 Feathers](https://www.adafruit.com/product/4702)
Ahoy! It's time to create a dazzling light up project with our new **RGB Matrix FeatherWing for nRF52840**. Now you can quickly and easily create projects featuring your favorite 16 or 32-pixel tall matrix boards. Using our RGB Matrix library...

In Stock
[Buy Now](https://www.adafruit.com/product/4702)
[Related Guides to the Product](https://learn.adafruit.com/products/4702/guides)
### Adafruit Feather nRF52840 Express

[Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)
The **Adafruit Feather nRF52840 Express** is the new Feather family member with Bluetooth® Low Energy and _native USB support_ featuring the nRF52840!&nbsp; It's our take on an 'all-in-one' Arduino-compatible + Bluetooth® Low Energy with built-in USB...

In Stock
[Buy Now](https://www.adafruit.com/product/4062)
[Related Guides to the Product](https://learn.adafruit.com/products/4062/guides)
### 64x32 RGB LED Matrix - 4mm pitch

[64x32 RGB LED Matrix - 4mm pitch](https://www.adafruit.com/product/2278)
Bring a little bit of Times Square into your home with this sweet 64 x 32 square RGB LED matrix panel. These panels are normally used to make video walls, here in New York we see them on the sides of busses and bus stops, to display animations or short video clips. We thought they looked...

In Stock
[Buy Now](https://www.adafruit.com/product/2278)
[Related Guides to the Product](https://learn.adafruit.com/products/2278/guides)
### Header Kit for Feather - 12-pin and 16-pin Female Header Set

[Header Kit for Feather - 12-pin and 16-pin Female Header Set](https://www.adafruit.com/product/2886)
These two&nbsp; **Female&nbsp;Headers** &nbsp;alone are, well, lonely. But pair them with any of our&nbsp;[Feather](https://www.adafruit.com/categories/777)&nbsp;boards and you're in business!

What do they do? They get soldered on either side of the Feather...

In Stock
[Buy Now](https://www.adafruit.com/product/2886)
[Related Guides to the Product](https://learn.adafruit.com/products/2886/guides)
### 5V 2A (2000mA) switching power supply - UL Listed

[5V 2A (2000mA) switching power supply - UL Listed](https://www.adafruit.com/product/276)
This is an FCC/CE certified and UL listed power supply. Need a lot of 5V power? This switching supply gives a clean regulated 5V output at up to 2000mA. 110 or 240 input, so it works in any country. The plugs are "US 2-prong" style so you may need a plug adapter, but you can pick one...

In Stock
[Buy Now](https://www.adafruit.com/product/276)
[Related Guides to the Product](https://learn.adafruit.com/products/276/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)

## Related Guides

- [Introducing the Adafruit nRF52840 Feather](https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather.md)
- [Machine Learning with Marshmallows and Tiny Sorter](https://learn.adafruit.com/machine-learning-with-marshmallows-and-tiny-sorter.md)
- [TVA Pruning Baton from Loki](https://learn.adafruit.com/tva-pruning-baton-from-loki.md)
- [Building the Assistive Technology Ultimate Remote](https://learn.adafruit.com/building-the-assistive-technology-ultimate-remote.md)
- [DIY Darksaber Build - 3D Print with PropMaker FeatherWing and BLE](https://learn.adafruit.com/ble-darksaber-propmaker.md)
- [Oculus Quest Battery Counterweight](https://learn.adafruit.com/oculus-quest-battery-counterweight.md)
- [RGB Matrix New York Times Title Scroller](https://learn.adafruit.com/rgb-matix-nyt-text-scroller.md)
- [Glowing Interactive Crystal Staff ](https://learn.adafruit.com/glowing-interactive-crystal-staff.md)
- [Deco Two-Key Feather Macro Pad](https://learn.adafruit.com/deco-two-key-keypad-macropad-circuitpython-feather.md)
- [Your Very First Circuit Sculpture](https://learn.adafruit.com/first-simple-circuit-sculpture.md)
- [DIY Robotic Sky Tracking Astrophotography Mount with CircuitPython](https://learn.adafruit.com/diy-robotic-sky-tracking-astrophotography-mount.md)
- [Where's My Friend? A Location-Aware Display with PyPortal and ItsASnap](https://learn.adafruit.com/where-s-my-friend-a-location-display-frame-with-pyportal.md)
- [MIDI Solenoid Drummer](https://learn.adafruit.com/midi-solenoid-drummer.md)
- [Multi-tasking with CircuitPython](https://learn.adafruit.com/multi-tasking-with-circuitpython.md)
- [Grand Central Soundboard in Ten Minutes](https://learn.adafruit.com/grand-central-soundboard-in-ten-minutes.md)
- [BLE Sniffer with nRF52840](https://learn.adafruit.com/ble-sniffer-with-nrf52840.md)
