# Fruit Jam Chyron

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/139/804/medium800/hacks_chyron_demo1.png?1758552463)

Display text superimposed over your live video stream with real-time updates using the Fruit Jam Chyron!

Just like "up to the minute" lower-thirds on a shopping network or newscast, you can composite text that is fed from a live data source. In our example, the product information, sale price, and up-to-the moment stock count for&nbsp;_ **JP's Product Pick of the Week** _ livestream.

![](https://cdn-learn.adafruit.com/assets/assets/000/139/803/medium800/hacks_chyron4.jpg?1758514200)

![](https://cdn-learn.adafruit.com/assets/assets/000/139/802/medium800/hacks_chyron1.jpg?1758513052)

https://www.youtube.com/live/dKicZS6RhKo?feature=shared&t=125

Info: The word "chyron" is a colloquial term for a graphic or text at the bottom of the title safe area of a broadcast TV screen. While the name comes from the Chyron Corporation, who started manufacturing broadcast graphics generators in the 1970s, the term "chyron" has become a generic term for this type of video overlay. The term "lower third" is also used interchangeably with "chyron".

## Parts
Featured
### 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)

Featured
### HDMI Input to USB 2.0 Video Capture Adapter

[HDMI Input to USB 2.0 Video Capture Adapter](https://www.adafruit.com/product/4669)
Here's&nbsp;one of the easiest capture solutions for getting HDMI data into your computer or Raspberry Pi, really any system with a USB port..

Use this capture device to convert a video signal from a camera (or another device) into a digital format your computer can recognize.&nbsp;...

In Stock
[Buy Now](https://www.adafruit.com/product/4669)
[Related Guides to the Product](https://learn.adafruit.com/products/4669/guides)
![Overhead shot of black USB-A-to-HDMI video capture adapter.](https://cdn-shop.adafruit.com/640x480/4669-10.jpg)

Featured
### Slim HDMI Cable - 450mm / 1.5 feet long

[Slim HDMI Cable - 450mm / 1.5 feet long](https://www.adafruit.com/product/2420)
Connect two HDMI devices together and save space with this slim, high quality HDMI cable. It has nice molded grips for easy installation and&nbsp;is 450mm long (~1.5 feet). Sporting a&nbsp;teeny&nbsp;4mm diameter this cable stays out of your way!

We also have slim HDMI cables at <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/2420)
[Related Guides to the Product](https://learn.adafruit.com/products/2420/guides)
![1.5 foot long slim HDMI cable.](https://cdn-shop.adafruit.com/640x480/2420-01.jpg)

Featured
### Black Woven USB C to USB A Cable - 2 meters long

[Black Woven USB C to USB A Cable - 2 meters long](https://www.adafruit.com/product/6324)
This cable is not only super-fashionable, with a woven pattern in classic Adafruit black, it's also made for USB C for our modernized breakout boards, Feathers, and more.&nbsp;

First, let's talk about the cover and over-molding. We got these in custom colors, and if you...

In Stock
[Buy Now](https://www.adafruit.com/product/6324)
[Related Guides to the Product](https://learn.adafruit.com/products/6324/guides)
![Angled shot of 2 meter long black, woven cable with USB-A and USB-C connectors connected to a laptop and a small, square microcontroller.](https://cdn-shop.adafruit.com/640x480/6324-00.jpg)

# Fruit Jam Chyron

## Install CircuitPython

[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.

## CircuitPython Quickstart

Follow this step-by-step to quickly get CircuitPython running on your board.

Warning: Please use the latest release of 10.x or higher for the Fruit Jam. Also use the latest libraries for the best functionality.

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

Save it wherever is convenient for you.

![install_circuitpython_on_rp2040_RP2040_UF2_downloaded.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/655/medium640/install_circuitpython_on_rp2040_RP2040_UF2_downloaded.jpg?1618943202)

![reset and boot highlighted](https://cdn-learn.adafruit.com/assets/assets/000/138/708/medium800/adafruit_products_Resetboot.jpg?1754331128 )

To enter the bootloader, hold down the **BOOT/**** BOOTSEL button**(highlighted in red above), and while continuing to hold it (don't let go!), press and release the**reset button**(highlighted in red or 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! **Make sure you have a USB cable you know is good for data sync.**

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

&nbsp;

Drag the **adafruit-circuitpython-_boardname_-_language_-_version_.uf2** file to **RP2350.**

![install_circuitpython_on_rp2350_Screenshot_2024-09-11_111518.png](https://cdn-learn.adafruit.com/assets/assets/000/132/253/medium640/install_circuitpython_on_rp2350_Screenshot_2024-09-11_111518.png?1726067809)

![install_circuitpython_on_rp2350_Screenshot_2024-09-11_111742.png](https://cdn-learn.adafruit.com/assets/assets/000/132/254/medium640/install_circuitpython_on_rp2350_Screenshot_2024-09-11_111742.png?1726067866)

The **RP2350** drive will disappear and a new disk drive called **CIRCUITPY** will appear.

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

![install_circuitpython_on_rp2350_Screenshot_2024-09-11_111843.png](https://cdn-learn.adafruit.com/assets/assets/000/132/255/medium640/install_circuitpython_on_rp2350_Screenshot_2024-09-11_111843.png?1726067932)

## Safe Mode

You want to edit your **code.py** or modify the files on your **CIRCUITPY** drive, but find that you can't. Perhaps your board has gotten into a state where **CIRCUITPY** is read-only. You may have turned off the **CIRCUITPY** drive altogether. Whatever the reason, safe mode can help.

Safe mode in CircuitPython does not run any user code on startup, and disables auto-reload. This means a few things. First, safe mode _bypasses any code in_ **boot.py** (where you can set **CIRCUITPY** read-only or turn it off completely). Second, _it does not run the code in_ **code.py**. And finally, _it does not automatically soft-reload when data is written to the_ **CIRCUITPY** _drive_.

Therefore, whatever you may have done to put your board in a non-interactive state, safe mode gives you the opportunity to correct it without losing all of the data on the **CIRCUITPY** drive.

### Entering Safe Mode
To enter safe mode when using CircuitPython, plug in your board or hit reset (highlighted in red above). Immediately after the board starts up or resets, it waits 1000ms. On some boards, the onboard status LED (highlighted in green above) will blink yellow during that time. If you press reset during that 1000ms, the board will start up in safe mode. It can be difficult to react to the yellow LED, so you may want to think of it simply as a slow double click of the reset button. (Remember, a fast double click of reset enters the bootloader.)

### In Safe Mode

If you successfully enter safe mode on CircuitPython, the LED will intermittently blink yellow three times.

If you connect to the serial console, you'll find the following message.

```terminal
Auto-reload is off.
Running in safe mode! Not running saved code.

CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.

Press any key to enter the REPL. Use CTRL-D to reload.
```

You can now edit the contents of the **CIRCUITPY** drive. Remember, _your code will not run until you press the reset button, or unplug and plug in your board, to get out of safe mode._

## Flash Resetting UF2

If your board ever gets into a really _weird_ state and CIRCUITPY doesn't show up as a disk drive after installing CircuitPython, try loading this 'nuke' UF2 to RP2350. which will do a 'deep clean' on your Flash Memory. **You will lose all the files on the board** , but at least you'll be able to revive it! After loading this UF2, follow the steps above to re-install CircuitPython.

[Download flash erasing "nuke" UF2 for RP2350](https://cdn-learn.adafruit.com/assets/assets/000/132/526/original/rp2350_flash_nuke.uf2)
# Fruit Jam Chyron

## Code the Fruit Jam

## Download the Project Bundle

Your project will use a specific set of CircuitPython libraries and&nbsp; **.py** &nbsp;files. To get everything you need, click on the&nbsp; **Download Project Bundle** &nbsp;link below, and uncompress the .zip file.

Drag the contents of the uncompressed bundle directory onto your board's&nbsp; **CIRCUITPY** &nbsp;drive, replacing any existing files or directories with the same names, and adding any new ones that are necessary.

![fruit jam product overlay files](https://adafruit.github.io/Adafruit_Learning_System_Guides/Fruit_Jam_Fruit_Jam_Product_Overlay.png )

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

This project creates a live product information overlay that fetches data from Adafruit's website and displays it on your HDMI monitor via the RP2350's HSTX DVI output. Below breaks down how each section works:

## Display Setup and Configuration

The code starts by requesting a 320x240 display configuration through the FruitJam peripheral system. This sets up the HSTX DVI video output to your HDMI display. The&nbsp;`supervisor.runtime.display` gives us access to CircuitPython's built-in display driver that's already configured for DVI output.

```auto
from adafruit_fruitjam.peripherals import request_display_config

BG_COLOR = 0x0000FF
request_display_config(320, 240)
display = supervisor.runtime.display
```

## Data Source Configuration

These variables define what data to fetch and where to find it in the JSON response. The lists contain JSONPath expressions. In this case, simple field names that tell the FruitJam library exactly which values to extract from Adafruit's product API.

```auto
DATA_SOURCE = "https://www.adafruit.com/api/products/6358"

TITLE_LOCATION = ["product_name"]
SALE_PRICE_LOCATION = ["product_sale_price"] 
REG_PRICE_LOCATION = ["product_price"]
STOCK_LOCATION = ["product_stock"]
```

## Visual Layout Presets

The `TEXT_POSITIONS` array contains five different overlay configurations. Each preset defines:

- **anchor\_point** : How text is aligned (0,0 = top-left, 1,1 = bottom-right)
- **anchored\_position** : Pixel coordinates for placement
- **outline\_size/color** : Text outline styling for readability over any background

For example, the first preset places the title at the bottom-left with a black outline, while preset 3 moves everything to the top of the screen. This gives you different overlay styles depending on your content.

## Dynamic Layout

This function updates both the internal FruitJam configuration and any existing on-screen labels when switching between visual presets. It handles both the data structure and the actual DisplayIO `label` objects.

```auto
def apply_hotkey_visuals(index):
    config = TEXT_POSITIONS[index]
    fruitjam.text_fields[0]["anchor_point"] = config["title_anchor_point"]
    # ... applies config to all three text fields
```

## Data Formatting

Before displaying the data, this function adds proper formatting - dollar signs for prices and "Stock:" labels. It also handles the case where a product isn't on sale by using the regular price instead.

```auto
def format_data(json_data):
    if "product_sale_price" in json_data:
        json_data["product_sale_price"] = f'${json_data["product_sale_price"]}'
    else:
        json_data["product_sale_price"] = f'${json_data["product_price"]}'
    
    json_data["product_stock"] = f'Stock: {json_data["product_stock"]}'
```

## FruitJam Library Initialization

The FruitJam library handles all the networking, JSON parsing, and display management. It's configured with:

- The API endpoint to fetch from
- Which JSON fields to extract
- A NeoPixel for network status indication
- The background color for the display
- The data formatting function to apply before display

```auto
fruitjam = FruitJam(
    url=DATA_SOURCE,
    json_path=(TITLE_LOCATION, STOCK_LOCATION, SALE_PRICE_LOCATION),
    status_neopixel=board.NEOPIXEL,
    default_bg=BG_COLOR,
    json_transform=[format_data],
    debug=True,
)
```

## Text Field Configuration

This sets up three text fields with different properties. The title field has text wrapping enabled (35 characters per line) and can hold longer text, while the stock and price fields are shorter with no wrapping.

The text positions and sizes are optimized for the &nbsp;default typeface, but you could pick your own using the `fruitjam.add_text(text_font=xxxx)` call.

```auto
fruitjam.remove_all_text()
fruitjam.add_text(text_wrap=35, text_maxlen=180, text_color=0xFFFFFF, outline_size=1)  # title
fruitjam.add_text(text_wrap=0, text_maxlen=30, text_color=0xFFFFFF, outline_size=1)   # stock  
fruitjam.add_text(text_wrap=0, text_maxlen=30, text_color=0xFFFFFF, outline_size=1)   # price
```

## Network Error Handling

The main loop handles two key functions: button debouncing for layout switching and automatic data refresh every 12 seconds. The button press cycles through the five visual presets, while the timer ensures your product information stays current.

```auto
while True:
    btn1_pressed = fruitjam.button1
    if btn1_pressed and not old_btn1:
        config_index = (config_index + 1) % len(TEXT_POSITIONS)
        apply_hotkey_visuals(config_index)
    
    now = time.monotonic()
    if last_fetch_time + FETCH_DELAY <= now:
        # Refresh data every 12 seconds
```

## DVI Video Output

While not explicitly shown in this code, the magic happens through CircuitPython's built-in support for the RP2350's HSTX peripheral. When you call `request_display_config()`, it configures the HSTX pins for DVI output, and `supervisor.runtime.display` provides a standard DisplayIO interface that automatically sends your graphics to the HDMI display. The FruitJam library uses this display object to render text overlays with hardware acceleration.

# Fruit Jam Chyron

## Fruit Jam Chyron Setup & Use

## Settings File

The Fruit Jam's ESP32-C6 WiFi co-processor allows us to go online for data. Edit or create a **settings.toml** file on the Fruit Jam to provide the SSID and password for your WiFi access point as shown&nbsp;[here](https://learn.adafruit.com/pico-w-wifi-with-circuitpython/create-your-settings-toml-file). A simple text editor on your computer is sufficient. Save the file to the root/main directory on the **CIRCUITPY** drive which appears when you plug the Fruit Jam into your computer via USB.

## Plugs

Plug the Fruit Jam into the computer via USB-C.

Plug one end of the HDMI cable into the DVI-D Video Output jack on the Fruit Jam.

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

## Capture Card

Plug the HDMI Video Capture card onto the HDMI cable, then plug it into a USB port on your computer. It will show up on the computer as a video source.

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

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

## OBS Setup

On it's own, the Fruit Jam Chyron displays text on a solid blue screen. Not super interesting on its own! However, we'll composite it over live video using [**Open Broadcaster Software**](https://obsproject.com/) ( **OBS** ) to give our livestreams some extra spice.

OBS is a great choice because it is fully featured, free and open source, and includes filters for color-keying video layers.

First, add your webcam or other main camera as usual (the one pointing at the host) to OBS. Then, add the Chyron.

## Add Video Capture Source

The HDMI capture card shows up like any video camera source. Add a video source, name it "fruitjam" and then pick your HDMI capture device.

![](https://cdn-learn.adafruit.com/assets/assets/000/139/806/medium640/hacks_chyron_demo11.png?1758555247)

![](https://cdn-learn.adafruit.com/assets/assets/000/139/807/medium640/hacks_chyron_demo12.png?1758555285)

## Add Color Key Filter

With the **fruijam** source layer selected, click the **Filters** button.

In the **Effects Filters** section, select **Color Key**.

Now, adjust the Color Key settings to key out the blue. Pick **Key Color Type** = **Blue.**

You can then adjust the **Similarity** value to remove any fringing around the letters where the blue value has been darkened or lightened during the capture conversion. The hard, aliased pixels of the Fruit Jam text help keep this potential issue to a minimum.

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

![](https://cdn-learn.adafruit.com/assets/assets/000/139/809/medium640/hacks_chyron_demo9.png?1758555360)

You'll now see a nice, clean matte around the text in your output monitor view, as shown here. Now Lars can focus on his hosting duties while the lower third takes care of itself!

![](https://cdn-learn.adafruit.com/assets/assets/000/139/816/medium800/hacks_chyron_demo8b.jpg?1758555541)

## During Broadcast

The chyron will automatically update with live data every 12 seconds. You can adjust the position and text outline on-screen by pressing the Fruit Jam's Button 1 as shown here:

![](https://cdn-learn.adafruit.com/assets/assets/000/139/805/medium800thumb/hacks_chyron_demo.jpg?1758554705)


## Guide 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)
### HDMI Input to USB 2.0 Video Capture Adapter

[HDMI Input to USB 2.0 Video Capture Adapter](https://www.adafruit.com/product/4669)
Here's&nbsp;one of the easiest capture solutions for getting HDMI data into your computer or Raspberry Pi, really any system with a USB port..

Use this capture device to convert a video signal from a camera (or another device) into a digital format your computer can recognize.&nbsp;...

In Stock
[Buy Now](https://www.adafruit.com/product/4669)
[Related Guides to the Product](https://learn.adafruit.com/products/4669/guides)
### Slim HDMI Cable - 450mm / 1.5 feet long

[Slim HDMI Cable - 450mm / 1.5 feet long](https://www.adafruit.com/product/2420)
Connect two HDMI devices together and save space with this slim, high quality HDMI cable. It has nice molded grips for easy installation and&nbsp;is 450mm long (~1.5 feet). Sporting a&nbsp;teeny&nbsp;4mm diameter this cable stays out of your way!

We also have slim HDMI cables at <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/2420)
[Related Guides to the Product](https://learn.adafruit.com/products/2420/guides)
### Black Woven USB C to USB A Cable - 2 meters long

[Black Woven USB C to USB A Cable - 2 meters long](https://www.adafruit.com/product/6324)
This cable is not only super-fashionable, with a woven pattern in classic Adafruit black, it's also made for USB C for our modernized breakout boards, Feathers, and more.&nbsp;

First, let's talk about the cover and over-molding. We got these in custom colors, and if you...

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

## Related Guides

- [Adafruit Fruit Jam](https://learn.adafruit.com/adafruit-fruit-jam.md)
- [Fruit Jam Motion Tracking Eyeballs](https://learn.adafruit.com/fruit-jam-motion-tracking-eyeballs.md)
- [Case for Feather RP2040 DVI](https://learn.adafruit.com/case-for-feather-rp2040-dvi.md)
- [Return to The Matrix with the Metro RP2350 or Fruit Jam](https://learn.adafruit.com/return-to-the-matrix-with-the-metro-rp2350.md)
- [RGB Matrix Panels With Raspberry Pi 5](https://learn.adafruit.com/rgb-matrix-panels-with-raspberry-pi-5.md)
- [Fruit Jam Case](https://learn.adafruit.com/fruit-jam-case.md)
- [Fruit Jam Sega Genesis](https://learn.adafruit.com/fruit-jam-sega-genesis.md)
- [Egg Hunt Maze Game on Fruit Jam](https://learn.adafruit.com/egg-hunt-maze-game-on-fruit-jam.md)
- [Fruit Jam Video Music](https://learn.adafruit.com/fruit-jam-video-music.md)
- [CircuitPython Text to Speech](https://learn.adafruit.com/circuitpython-text-to-speech.md)
- [Snake Game on Metro RP2350](https://learn.adafruit.com/snake-game-on-metro-rp2350.md)
- [Fruit Jam SSTV Receiver](https://learn.adafruit.com/fruit-jam-sstv-reciever.md)
- [Intel 286 Emulator on Fruit Jam](https://learn.adafruit.com/intel-286-emulator-on-fruit-jam.md)
- [Startup Screens](https://learn.adafruit.com/startup-screens.md)
- [Match3 Game on the Fruit Jam and  Adafruit Metro RP2350](https://learn.adafruit.com/match3-game-on-metro-rp2350.md)
- [Computer Graphics Turbo Demos](https://learn.adafruit.com/computer-graphics-turbo-demos.md)
