# Return to The Matrix with the Metro RP2350 or Fruit Jam

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/135/668/medium800thumb/adafruit_metro_large_4-3.jpg?1741124316)

Return to The Matrix with this project recreation. The falling streams of green characters are strange yet calming.&nbsp;

From [Quora](https://www.quora.com/What-is-the-significance-of-the-computer-screen-used-in-Matrix-How-could-they-read-this-screen-What-language-is-it), the significance of The Matrix computer screen

1. Representation of Reality: The screen symbolizes the digital nature of the Matrix itself. It reflects how the simulated world is constructed and manipulated by the machines controlling humanity.
2. Alternative Perception: Characters like Neo and Morpheus use the screen to perceive the underlying code of the Matrix. It represents the ability to see beyond the illusion of the real world and understand the truth of their existence.
3. Coding Language: The characters are able to read the screen because it displays the Matrix's code, which is a visual representation of the program that constructs their reality. This code is often depicted in green characters on a black background, reminiscent of classic computer interfaces.

Or, it just makes a cool visualization.

This project displays high resolution video generated by an Adafruit Metro RP2350 or Adafruit Fruit Jam. The HSTX bus outputs DVI video which can be shown on an HDMI monitor. The Adafruit-DVI-HSTX library makes the project easy to write programs like this in Arduino, while displayio makes it easy in CircuitPython. No soldering required with the Fruit Jam!

## Parts
### Adafruit Fruit Jam - Mini RP2350 Computer

[Adafruit Fruit Jam - Mini RP2350 Computer](https://www.adafruit.com/product/6200)
We were catching up on a recent [hackaday hackchat with eben upton](https://hackaday.io/event/202122-raspberry-pi-hack-chat-with-eben-upton)&nbsp;and learned some fun facts: such as the DVI hack for the RP2040 was inspired by <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/6200)
[Related Guides to the Product](https://learn.adafruit.com/products/6200/guides)
![Angled shot of assembled mini computer PCB with plate.](https://cdn-shop.adafruit.com/640x480/6200-10.jpg)

- or -&nbsp;

### Adafruit Metro RP2350

[Adafruit Metro RP2350](https://www.adafruit.com/product/6003)
Choo! Choo! This is the RP2350 Metro Line, making all station stops at "Dual Cortex M33 mountain", "528K RAM round-about" and "16 Megabytes of Flash town". This train is piled high with hardware that complements the Raspberry Pi RP2350 chip to make it an excellent...

In Stock
[Buy Now](https://www.adafruit.com/product/6003)
[Related Guides to the Product](https://learn.adafruit.com/products/6003/guides)
![Angled shot of black, credit card-sized microcontroller with stacking headers.](https://cdn-shop.adafruit.com/640x480/6003-06.jpg)

### Adafruit RP2350 22-pin FPC HSTX to DVI Adapter for HDMI Displays

[Adafruit RP2350 22-pin FPC HSTX to DVI Adapter for HDMI Displays](https://www.adafruit.com/product/6055)
You may have noticed that our [RP2350 Feather](https://www.adafruit.com/product/6000) has an FPC output connector on the end&nbsp;for accessing the HSTX (High Speed Transmission)&nbsp;peripheral. This new capability, not available on the RP2040, is specifically designed to allow the...

In Stock
[Buy Now](https://www.adafruit.com/product/6055)
[Related Guides to the Product](https://learn.adafruit.com/products/6055/guides)
![black, square-shaped breakout board with DVI and 22-pin FPC connectors connected to a black, rectangular microcontroller.](https://cdn-shop.adafruit.com/640x480/6055-01.jpg)

### 22-pin 0.5mm pitch FPC Flex Cable for DSI CSI or HSTX - 20cm

[22-pin 0.5mm pitch FPC Flex Cable for DSI CSI or HSTX - 20cm](https://www.adafruit.com/product/6036)
Connect this to that when a 22-pin FPC connector is needed. This 20 cm long cable is made of a flexible PCB. It's A-B style, meaning that pin one on one side will match with pin one on the other. How handy!

[We're stocking this to...](https://www.adafruit.com/category/360)

In Stock
[Buy Now](https://www.adafruit.com/product/6036)
[Related Guides to the Product](https://learn.adafruit.com/products/6036/guides)
![Angled shot of 20cm long, 22-pin FPC cable.](https://cdn-shop.adafruit.com/640x480/6036-00.jpg)

You likely have a USB cable, HDMI cable and monitor. If not, you can look to get these:

### USB Type A to Type C Cable - approx 1 meter / 3 ft long

[USB Type A to Type C Cable - approx 1 meter / 3 ft long](https://www.adafruit.com/product/4474)
As technology changes and adapts, so does Adafruit. This&nbsp;&nbsp; **USB Type A to Type C** cable will help you with the transition to USB C, even if you're still totin' around a USB Type A hub, computer or laptop.

USB C is the latest industry-standard connector for...

In Stock
[Buy Now](https://www.adafruit.com/product/4474)
[Related Guides to the Product](https://learn.adafruit.com/products/4474/guides)
![Angled shot of a coiled black, USB-C to USB-A cable.](https://cdn-shop.adafruit.com/640x480/4474-02.jpg)

### HDMI Cable - 1 meter

[HDMI Cable - 1 meter](https://www.adafruit.com/product/608)
Connect two HDMI devices together with this basic HDMI cable. It has nice molded grips for easy installation, and is 1 meter long (about 3 feet). This is a HDMI 1.3 cable.

We're now stocking a very fancy Official Raspberry Pi cable with overmolding and a Pi logo. Please note...

In Stock
[Buy Now](https://www.adafruit.com/product/608)
[Related Guides to the Product](https://learn.adafruit.com/products/608/guides)
![Official Raspberry Pi HDMI Cable - 1 meter](https://cdn-shop.adafruit.com/640x480/608-03.jpg)

### Raspberry Pi Monitor - Red and White Colorway

[Raspberry Pi Monitor - Red and White Colorway](https://www.adafruit.com/product/6088)
The Raspberry Pi Monitor is a 15.6" full HD computer display. It's the perfect compact, versatile, user-friendly desktop display companion for Raspberry Pi computers and other devices. Coming in the signature Red and White Colors this ties in perfectly to the <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/6088)
[Related Guides to the Product](https://learn.adafruit.com/products/6088/guides)
![Demo Shot of the Raspberry Pi Monitor (Red/White) with the Raspberry Pi 400 Desktop - Full Computer Kit.](https://cdn-shop.adafruit.com/640x480/6088-06.jpg)

# Return to The Matrix with the Metro RP2350 or Fruit Jam

## Preparing the Metro RP2350

## HSTX Connection to DVI
![](https://cdn-learn.adafruit.com/assets/assets/000/135/671/medium800/adafruit_metro_gaming_hstx.png?1741127260)

Get the HSTX cable. Any length Adafruit sells is fine. CAREFULLY lift the dark grey bar up on the Metro, insert the cable silver side down, blue side up, then put the bar CAREFULLY down, ensuring it locks in. If it feels like it doesn't want to go, do not force it.

Do the same with the other end on the DVI breakout. Note that the DVI breakout will be inverted/upside down when compared to the Metro - this is normal for these boards and the Adafruit cables.

That's it - no soldering, easy!

# Return to The Matrix with the Metro RP2350 or Fruit Jam

## UF2 and Arduino Versions

### Metro RP2350
![](https://cdn-learn.adafruit.com/assets/assets/000/135/675/medium800/programming_adafruit_products_boot_reset_btn_highlights.png?1741128585)

Download the .UF2 file below by clicking the green box. Save the file to your computer. Plug your Metro RP2350 into your computer via a known good USB data+power cable (data + power, not a charge only cable).

Hold down the **BOOT/**** BOOTSEL button**(highlighted in red above), and while continuing to hold it (don't let go!), press and release the&nbsp;**reset button&nbsp;**(highlighted in blue above).**Continue to hold the BOOT/BOOTSEL button **until the** RP2350 **drive appears on your computer.** &nbsp; **Copy the .UF2 file you saved previously to the** RP2350** drive and The Matrix should appear if you have the display connected.

[Metro RP2350 matrix.uf2](https://cdn-learn.adafruit.com/assets/assets/000/135/669/original/matrix.uf2?1741126366)
### Fruit Jam
![](https://cdn-learn.adafruit.com/assets/assets/000/141/593/medium800/circuitpython_20250929ohm.jpg?1765412100)

Download the .UF2 file below by clicking the green box. Save the file to your computer. Plug your Fruit Jam into your computer via a known good USB data+power cable.

To enter the bootloader, hold down the&nbsp; **BOOT/**** BOOTSEL button&nbsp;**(highlighted in red above labeled Button #1), and while continuing to hold it (don't let go!), press and release the&nbsp;**reset button&nbsp;**(highlighted in blue above).&nbsp;**Continue to hold the BOOT/BOOTSEL button until the RP2350 drive appears!**

If the drive does not appear, release all the buttons, and then repeat the process above.

You can also start with your board unplugged from USB, press and hold the BOOTSEL button (highlighted in red above), continue to hold it while plugging it into USB, and wait for the drive to appear before releasing the button.

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

You will see a new disk drive appear called&nbsp; **RP2350**.&nbsp;

Drag the **matrix\_fruitjam****.uf2 **&nbsp;file to&nbsp;** RP2350.** The program should immediately start.

[Fruit Jam matrix.uf2](https://cdn-learn.adafruit.com/assets/assets/000/141/592/original/matrix_fruitjam.uf2?1765411876)
## Arduino Code (if you want)

Please refer to the Arduino IDE setup in the&nbsp;[Adafruit Metro RP2350 guide](https://learn.adafruit.com/adafruit-metro-rp2350/arduino-ide-setup) or [Fruit Jam Guide](https://learn.adafruit.com/adafruit-fruit-jam/arduino-ide-setup), depending on your board.

### Adafruit Metro RP2350 - Arduino IDE Setup

[Adafruit Metro RP2350](https://learn.adafruit.com/adafruit-metro-rp2350)
[Arduino IDE Setup](https://learn.adafruit.com/adafruit-metro-rp2350/arduino-ide-setup)
### Adafruit Fruit Jam - Arduino IDE Setup

[Adafruit Fruit Jam](https://learn.adafruit.com/adafruit-fruit-jam)
[Arduino IDE Setup](https://learn.adafruit.com/adafruit-fruit-jam/arduino-ide-setup)
You will want to add the library Adafruit DVI HSTX (version 1.10 or later, likely the latest version) to your Arduino environment. Select Sketch - \> Include Library -\> Manage Libraries... Search for "Adafruit DVI HSTX" by Jeff Epler. You will want version 1.1.0 or later, likely the newest version. Click Install and accept installing libraries that Adafruit DVI HSTX is dependent on. Those are the only libraries which need to be loaded.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/670/medium800/adafruit_metro_Screenshot_2025-03-04_161540.jpg?1741126567)

### For Metro RP2350

For the main program, get the code by clicking the "Download File" button below. Extract the file&nbsp; **Metro\_HSTX\_Matrix.ino** from the zip archive. Load it into the Arduino IDE.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Metro/Metro_HSTX_Matrix/Metro_HSTX_Matrix.ino

Select Adafruit Metro RP2350 as the board in the box in the toolbar.&nbsp;

Plug your Metro into your computer via a known good USB data + power cable (not the tiny power-only cables that come with battery packs). The Metro should show up as a new serial port. Select that serial port under Tools -\> Port.

Click the arrow key -\> on the toolbar to compile the program and upload it to the Metro.

### For Fruit Jam
For the main program, get the code by clicking the "Download File" button below. Extract the file&nbsp; **matrix\_fruitjam.ino** from the zip archive. Load it into the Arduino IDE.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Metro/Metro_HSTX_Matrix/matrix_fruitjam.ino

Select Adafruit Fruit Jam as the board in the box in the toolbar.&nbsp;

Plug your Fruit Jam into your computer via a known good USB data + power cable (not the tiny power-only cables that come with battery packs). The Fruit Jam should show up as a new serial port. Select that serial port under Tools -\> Port.

Click the arrow key -\> on the toolbar to compile the program and upload it to the Fruit Jam.

## Changing the Code

You can change how many streams are on the screen at the same time by changing the `STREAM_CREATION_CHANCE` variable. It should be from `10` (lowest) to `99` (highest).

You can change the speed of the animation by changing the `ANIMATION_SPEED` variable.

# Return to The Matrix with the Metro RP2350 or Fruit Jam

## CircuitPython Version

With some help from the&nbsp;_friendly_ robot Claude.ai, Tim ported the Matrix rain Arduino code to CircuitPython.

All of the same functions from the Arduino version of the code have counterparts in the CircuitPython version. In order to render glyphs, a `TileGrid` is used along with [a spritesheet](https://github.com/adafruit/Adafruit_Learning_System_Guides/raw/refs/heads/main/Metro/Metro_RP2350_CircuitPython_Matrix/matrix_characters.bmp) containing some Japanese Katakana characters from [Unifoundry](https://unifoundry.com/unifont/index.html), as well as the letters used to spell "Adafruit", "jam" and "matrix".

All characters are rendered mirrored horizontally by using the `flip_x` property of the `TileGrid` as was done in the movie graphics. The characters are larger than those in the Arduino version.

For coloring the glyphs, a [TilePaletteMapper](https://docs.circuitpython.org/en/latest/shared-bindings/tilepalettemapper/index.html#tilepalettemapper.TilePaletteMapper) is used. This class is a special kind of `pixel_shader` that allows us to re-map color indexes for individual tiles within a&nbsp;`TileGrid`. The code uses 16 shades of green in the `shader_palette`. As it renders the falling glyphs, their colors are set by adjusting the mapping at their x,y location within the grid to a color index for a green that has brightness relative to their position in the stream.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/003/medium800thumb/programming_circuitpython_matrix_rain.jpg?1742937841)

## Project Setup

Are you new to using CircuitPython? No worries,&nbsp;[there is a full getting-started guide here](https://learn.adafruit.com/welcome-to-circuitpython "Welcome to CircuitPython").

Plug the device into your computer with a known good USB cable (not a charge-only cable). The device will appear to your computer in File Explorer or Finder (depending on your operating system) as a flash drive named&nbsp; **CIRCUITPY**. If the drive does not appear, you can&nbsp;[install CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython)&nbsp;on your device and then return here.

Download the project files with the Download Project Bundle button below.&nbsp;Unzip the file and copy/paste the&nbsp; **code.py** &nbsp;and other project files to your&nbsp; **CIRCUITPY** &nbsp;drive using File Explorer or Finder (depending on your operating system).

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

# Return to The Matrix with the Metro RP2350 or Fruit Jam

## Usage

![](https://cdn-learn.adafruit.com/assets/assets/000/135/672/medium800/adafruit_metro_20250304_151533.jpg?1741127994)

Plug the Metro into a HDMI monitor via an HDMI cable.

Power the Metro RP2350 either via USB C (5 volts) or the barrel power connection (5.5 to 17 volts DC, center positive).&nbsp;

The Matrix animation will automatically start!

![](https://cdn-learn.adafruit.com/assets/assets/000/135/673/medium800thumb/adafruit_metro_full_small.jpg?1741128010)

![](https://cdn-learn.adafruit.com/assets/assets/000/135/674/medium800thumb/adafruit_metro_large_4-3.jpg?1741128028)

## Changing the Number of Streams

&nbsp;

See the Arduino and CircuitPython pages for the variable you'll want to change to get more or fewer streams.


## Featured Products

### Adafruit Fruit Jam - Mini RP2350 Computer

[Adafruit Fruit Jam - Mini RP2350 Computer](https://www.adafruit.com/product/6200)
We were catching up on a recent [hackaday hackchat with eben upton](https://hackaday.io/event/202122-raspberry-pi-hack-chat-with-eben-upton)&nbsp;and learned some fun facts: such as the DVI hack for the RP2040 was inspired by <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/6200)
[Related Guides to the Product](https://learn.adafruit.com/products/6200/guides)
### Adafruit Metro RP2350

[Adafruit Metro RP2350](https://www.adafruit.com/product/6003)
Choo! Choo! This is the RP2350 Metro Line, making all station stops at "Dual Cortex M33 mountain", "528K RAM round-about" and "16 Megabytes of Flash town". This train is piled high with hardware that complements the Raspberry Pi RP2350 chip to make it an excellent...

In Stock
[Buy Now](https://www.adafruit.com/product/6003)
[Related Guides to the Product](https://learn.adafruit.com/products/6003/guides)
### Adafruit RP2350 22-pin FPC HSTX to DVI Adapter for HDMI Displays

[Adafruit RP2350 22-pin FPC HSTX to DVI Adapter for HDMI Displays](https://www.adafruit.com/product/6055)
You may have noticed that our [RP2350 Feather](https://www.adafruit.com/product/6000) has an FPC output connector on the end&nbsp;for accessing the HSTX (High Speed Transmission)&nbsp;peripheral. This new capability, not available on the RP2040, is specifically designed to allow the...

In Stock
[Buy Now](https://www.adafruit.com/product/6055)
[Related Guides to the Product](https://learn.adafruit.com/products/6055/guides)
### 22-pin 0.5mm pitch FPC Flex Cable for DSI CSI or HSTX - 20cm

[22-pin 0.5mm pitch FPC Flex Cable for DSI CSI or HSTX - 20cm](https://www.adafruit.com/product/6036)
Connect this to that when a 22-pin FPC connector is needed. This 20 cm long cable is made of a flexible PCB. It's A-B style, meaning that pin one on one side will match with pin one on the other. How handy!

[We're stocking this to...](https://www.adafruit.com/category/360)

In Stock
[Buy Now](https://www.adafruit.com/product/6036)
[Related Guides to the Product](https://learn.adafruit.com/products/6036/guides)
### USB Type A to Type C Cable - approx 1 meter / 3 ft long

[USB Type A to Type C Cable - approx 1 meter / 3 ft long](https://www.adafruit.com/product/4474)
As technology changes and adapts, so does Adafruit. This&nbsp;&nbsp; **USB Type A to Type C** cable will help you with the transition to USB C, even if you're still totin' around a USB Type A hub, computer or laptop.

USB C is the latest industry-standard connector for...

In Stock
[Buy Now](https://www.adafruit.com/product/4474)
[Related Guides to the Product](https://learn.adafruit.com/products/4474/guides)
### HDMI Cable - 1 meter

[HDMI Cable - 1 meter](https://www.adafruit.com/product/608)
Connect two HDMI devices together with this basic HDMI cable. It has nice molded grips for easy installation, and is 1 meter long (about 3 feet). This is a HDMI 1.3 cable.

We're now stocking a very fancy Official Raspberry Pi cable with overmolding and a Pi logo. Please note...

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

## Related Guides

- [Adafruit RP2350 22-pin FPC HSTX to DVI Adapter](https://learn.adafruit.com/adafruit-rp2350-22-pin-fpc-hstx-to-dvi-adapter.md)
- [Adafruit Metro RP2350](https://learn.adafruit.com/adafruit-metro-rp2350.md)
- [Adafruit Fruit Jam](https://learn.adafruit.com/adafruit-fruit-jam.md)
- [Breakout Game on the Metro RP2350 and Fruit Jam](https://learn.adafruit.com/breakout-game-on-metro-rp2350-and-fruit-jam.md)
- [Using a Mouse with USB Host](https://learn.adafruit.com/using-a-mouse-with-usb-host.md)
- [Solderless Robot Toy Xylophone](https://learn.adafruit.com/solderless-robot-toy-xylophone.md)
- [Chip's Challenge on Fruit Jam and Metro RP2350](https://learn.adafruit.com/256-color-gaming-on-the-metro-rp2350.md)
- [Create a Memory Game on Fruit Jam Metro RP2350](https://learn.adafruit.com/create-a-memory-game-on-metro-rp2350.md)
- [How to Choose a Microcontroller](https://learn.adafruit.com/how-to-choose-a-microcontroller.md)
- [Flappy Nyan Cat Game on Fruit Jam and Metro RP2350](https://learn.adafruit.com/flappy-nyan-cat-game-on-metro-rp2350.md)
- [Minesweeper on the Fruit Jam and Metro RP2350](https://learn.adafruit.com/minesweeper-on-metro-rp2350.md)
- [Snake Game on Metro RP2350](https://learn.adafruit.com/snake-game-on-metro-rp2350.md)
- [Using DVI Video in CircuitPython](https://learn.adafruit.com/using-dvi-video-in-circuitpython.md)
- [Using a Keyboard with USB Host](https://learn.adafruit.com/using-a-keyboard-with-usb-host.md)
- [Adafruit MacroPad RP2040](https://learn.adafruit.com/adafruit-macropad-rp2040.md)
- [Living Starry Night Painting](https://learn.adafruit.com/animated-starry-night-circuit-playground-express.md)
- [LED Matrix Display for Bitmap Pixel Art and Animation](https://learn.adafruit.com/pixel-art-matrix-display.md)
