# Fruit Jam Video Music

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/140/072/medium800thumb/circuitpython_randomMode.jpg?1759257550 )

Did you miss out on your chance on an [Atari Video Music](https://en.wikipedia.org/wiki/Atari_Video_Music) back in the day? Worry not, because with the powers of [Fruit Jam](https://www.adafruit.com/product/6200) and [CircuitPython](https://circuitpython.org/) combined, you can build an homage to the short lived but legendary psychedelic music visualizer. A PDM microphone samples incoming audio over time and analyzes it via a&nbsp;[fast Fourier transform (FFT)](https://en.wikipedia.org/wiki/Fast_Fourier_transform). The three animations visualize the amplitude and frequencies of your music in real-time.

https://youtube.com/shorts/dpKTPv3oZ1M

There are three animations that you can choose from: diamonds, party parrots or dancing lines. If you just can't choose, you can select the auto-play mode, which will change up the animation at random every 30 seconds.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/078/medium640/circuitpython_edited_P1480276.jpg?1759262785)

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

### Step Switch with LED - Three Pack of Gray Plastic with Red LED

[Step Switch with LED - Three Pack of Gray Plastic with Red LED](https://www.adafruit.com/product/5498)
These hinged momentary step switches are evocative of the [16-step sequencer keys on TR-808 sythesizers](https://en.wikipedia.org/wiki/Roland_TR-808).&nbsp;Also sometimes used on A/V equipment, they're very tactile, with a good clicky feel. And of course, the built in red LED is...

In Stock
[Buy Now](https://www.adafruit.com/product/5498)
[Related Guides to the Product](https://learn.adafruit.com/products/5498/guides)
![Angled shot of three gray plastic step switches with LED.](https://cdn-shop.adafruit.com/640x480/5498-06.jpg)

### PB86 Step Switch Breadboard-Friendly Breakout PCB - Pack of 12

[PB86 Step Switch Breadboard-Friendly Breakout PCB - Pack of 12](https://www.adafruit.com/product/5631)
A couple of months ago we started carrying [packs of colorful step switches](https://www.adafruit.com/product/5517)&nbsp;reminiscent of the [16-step sequencer keys on TR-808 synthesizers](https://en.wikipedia.org/wiki/Roland_TR-808). We gave folks the heads up that the...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5631)
[Related Guides to the Product](https://learn.adafruit.com/products/5631/guides)
![Overhead shot of PCB panel contain two rows of five step-switch breakouts.](https://cdn-shop.adafruit.com/640x480/5631-02.jpg)

### Panel Mount 10K potentiometer (Breadboard Friendly)

[Panel Mount 10K potentiometer (Breadboard Friendly)](https://www.adafruit.com/product/562)
This potentiometer is a two-in-one, good in a breadboard or with a panel. It's a fairly standard linear taper 10K ohm potentiometer, with a grippy shaft. It's smooth and easy to turn, but not so loose that it will shift on its own. We like this one because the legs are 0.2" apart...

In Stock
[Buy Now](https://www.adafruit.com/product/562)
[Related Guides to the Product](https://learn.adafruit.com/products/562/guides)
![Angled Shot of the Panel Mount 10K potentiometer (Breadboard Friendly)](https://cdn-shop.adafruit.com/640x480/562-03.jpg)

### Adafruit PDM Microphone Breakout with JST SH Connector

[Adafruit PDM Microphone Breakout with JST SH Connector](https://www.adafruit.com/product/4346)
An exotic new microphone has arrived in the Adafruit shop, a **PDM MEMS Microphone**! PDM is the 'third' kind of microphone you can integrate with electronics, apart from analog or I2S. These microphones are very commonly used in products, but are rarely seen in maker...

In Stock
[Buy Now](https://www.adafruit.com/product/4346)
[Related Guides to the Product](https://learn.adafruit.com/products/4346/guides)
![A small, square-shaped, PDM Microphone breakout with a JST-SH connector.](https://cdn-shop.adafruit.com/640x480/4346-08.jpg)

### STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable

[STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable](https://www.adafruit.com/product/4209)
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 Dupont male 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...

In Stock
[Buy Now](https://www.adafruit.com/product/4209)
[Related Guides to the Product](https://learn.adafruit.com/products/4209/guides)
![Angled Shot of the STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable.](https://cdn-shop.adafruit.com/640x480/4209-05.jpg)

### Part: STEMMA JST PH 2mm 3-Pin to Male Header Cable
quantity: 1
200 mm
[STEMMA JST PH 2mm 3-Pin to Male Header Cable](https://www.adafruit.com/product/3893)

### Part: Anodized Aluminum Machined Knob
quantity: 1
20mm Diameter
[Anodized Aluminum Machined Knob](https://www.adafruit.com/product/5528)

### Part: Adafruit Perma-Proto Half-sized Breadboard PCB
quantity: 1
Half-sized
[Adafruit Perma-Proto Half-sized Breadboard PCB](https://www.adafruit.com/product/1609)

### Part: IDC Breakout Helper - 2x8
quantity: 2
16 pin
[IDC Breakout Helper - 2x8](https://www.adafruit.com/product/2104)

### Part: USB C Cable
quantity: 1
USB A to USB C Cable - 2 meters long
[USB C Cable](https://www.adafruit.com/product/5044)

### Part: HDMI Cable
quantity: 1
HDMI cable
[HDMI Cable](https://www.adafruit.com/product/2421)

### Part: Black Nylon Machine Screw and Stand-off Set 
quantity: 1
M2.5 Thread
[Black Nylon Machine Screw and Stand-off Set ](https://www.adafruit.com/product/3299)

### Part: Black Nylon Machine Screw and Stand-off Set
quantity: 1
M3 thread
[Black Nylon Machine Screw and Stand-off Set](https://www.adafruit.com/product/4685)

### Part: Break-away 0.1" 36-pin strip male header
quantity: 1
10 pack
[Break-away 0.1" 36-pin strip male header](https://www.adafruit.com/product/392)

# Fruit Jam Video Music

## Circuit Diagram

![fritzing diagram for the video music. a perma proto is plugged into the fruit jam. step switches and pdm mic are soldered to the perma proto. analog pot is plugged into the A0 jst-ph port](https://cdn-learn.adafruit.com/assets/assets/000/139/695/medium800/circuitpython_fruitJamVideoMusicPermaProto_bb.jpg?1758053801 )

The circuit is built onto a [perma-proto board](https://www.adafruit.com/product/1609). The boards have rows labeled with letters and columns labeled with numbers. These labels will be referenced for part and wire placement on the [Wiring page](https://learn.adafruit.com/fruit-jam-video-music/wiring).

### Fruit Jam Video Music - Wiring

[Fruit Jam Video Music](https://learn.adafruit.com/fruit-jam-video-music)
[Wiring](https://learn.adafruit.com/fruit-jam-video-music/wiring)
![](https://cdn-learn.adafruit.com/assets/assets/000/140/069/medium800/circuitpython_fruitJamVideoMusic_bb.png?1759256732 )

This Fritzing diagram shows which pins are used by the different components.

### Step Switches

- **Step Switch 1 O** to **Fruit Jam A1 (cyan wire)**
- **Step Switch 1 +** to **Fruit Jam A2 (purple wire)**
- **Step Switch 2 O** to **Fruit Jam A3 (green wire)**
- **Step Switch 2 +** to **Fruit Jam A4 (orange wire)**
- **Step Switch 1 & 2 M and -** to **Fruit Jam GND (black wire)**

### PDM Mic

- **Mic GND** to **Fruit Jam GND (black wire)**
- **Mic VDD** to **Fruit Jam 3V (red wire)**
- **Mic DAT** to **Fruit Jam D7 (blue wire)**
- **Mic CLK** to **Fruit Jam D6 (yellow wire)**

### Potentiometer

- **Pot GND** to **Fruit Jam JST-PH GND (black wire)**
- **Pot wiper** to **Fruit Jam JST-PH A0 (white wire)**
- **Pot positive** to **Fruit Jam JST-PH positive (red wire)**

# Fruit Jam Video Music

## 3D Printing

![two enclosures for the fruit jam video music](https://cdn-learn.adafruit.com/assets/assets/000/140/049/medium800/circuitpython_edited_P1480208.jpg?1759254416 )

You can 3D print all of the parts for this project. They are designed to be connected together with M3 screws.

The STL files can be downloaded directly below or from Printables. There are two versions: 3D printed only and wood veneer.

[fruitJamVideoMusic_CAD.zip](https://cdn-learn.adafruit.com/assets/assets/000/140/067/original/fruitJamVideoMusic_CAD.zip?1759256510)
[Printables Download](https://www.printables.com/model/1430277-fruit-jam-video-music)
The case has cutouts for the PDM mic, DVI port, USB-C port, step switches and potentiometer. Everything is secured with M2.5 or M3 screws. The stand-offs help to stabilize the perma-proto board. The Fruit Jam logo is embossed on both sides of the case.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/064/medium640/circuitpython_edited_P1480210.jpg?1759255113)

## Vintage Wood Veneer Vibes
[FruitJamVideoMusic_VeneerFiles.zip](https://cdn-learn.adafruit.com/assets/assets/000/140/068/original/FruitJamVideoMusic_VeneerFiles.zip?1759256525)
If you want to go the extra mile, you can cut some walnut veneer to cover the lid and add a Fruit Jam logo inlay on either side of the enclosure. E6000 glue is recommended for securing the pieces in place. It turns to a gummy texture when it's dry, so you can easily clean-up any wayward streaks unlike super glue.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/065/medium640/circuitpython_edited_P1480211.jpg?1759255213)

A Cricut Maker was used to cut out the version in this guide. The Cricut app lets you bring in SVG files and has a wood veneer preset for cutting.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/066/medium640/circuitpython_View_recent_photos.png?1759255788)

# Fruit Jam Video Music

## 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 Video Music

## Code

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

To do this, click on the **Download Project Bundle** button in the window below. It will download to your computer as a zipped folder.

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

## Upload the Code, Bitmap and Libraries to the Fruit Jam

After downloading the Project Bundle, plug your Fruit Jam into the computer's USB port with a known good USB data+power cable. You should see a new flash drive appear in the computer's File Explorer or Finder (depending on your operating system) called **CIRCUITPY**. Unzip the folder and copy the following items to the Fruit Jam's **CIRCUITPY** drive.

- **lib** folder
- **partyParrotsXtraSmol.bmp**
- **code.py**

Your Fruit Jam **CIRCUITPY** drive should look like this after copying the **lib** folder, **partyParrotsXtraSmol.bmp** and **code.py** files:

![CIRCUITPY drive](https://adafruit.github.io/Adafruit_Learning_System_Guides/Fruit_Jam_Fruit_Jam_Video_Music.png )

## How the Code Works

At the top of the code, the `picodvi` framebuffer is initialized. Following that, the shared variables across the animations are declared. Finally, the potentiometer, PDM microphone, step switches and step switch LEDs are setup.

```python
# ------ PICODVI SETUP ------
displayio.release_displays()
fb = picodvi.Framebuffer(320, 240, clk_dp=board.CKP, clk_dn=board.CKN,
                         red_dp=board.D0P, red_dn=board.D0N,
                         green_dp=board.D1P, green_dn=board.D1N,
                         blue_dp=board.D2P, blue_dn=board.D2N,
                         color_depth=8)
display = framebufferio.FramebufferDisplay(fb, auto_refresh=False)

# ------ SHARED VARIABLES ------
fft_size = 512
low_bin = 15
high_bin = 75
low_band = (15, 75)
mid_band = (100, 120)
spectrum_size = fft_size // 2
spectrum_bits = log(spectrum_size, 2)
mode = 0
new_mode = True
states = {}

# ------ PDM MIC ------
mic = PDMIn(board.D6, board.D7, sample_rate=44100, bit_depth=16)
rec_buf = array("H", [0] * fft_size)

# ------ POTENTIOMETER SETUP ------
pot1 = AnalogIn(board.A0)
read_pots = True
# ------ POTENTIOMETER MODE VALUES ------
mode0_values = [0, 0, 0]
mode1_values = [0, 0, 0]
mode2_values = [0, 0, 0]
mode_vals = [0, 0, 0]
# ------ POTENTIOMETER READ FUNCTION ------
def val(pin):
    return pin.value

# ------ SWITCH SETUP ------
keys = keypad.Keys((board.A1, board.A3), value_when_pressed=False, pull=True)

# ------ LED SETUP ------
led_0 = DigitalInOut(board.A2)
led_0.direction = Direction.OUTPUT
led_1 = DigitalInOut(board.A4)
led_1.direction = Direction.OUTPUT

leds = [led_0, led_1]
```

## The Animations

There are three animations: diamonds, party parrots and dancing lines. Each animation has two associated functions: an initialization and the actual animation. The initialization is run once when the mode is changed to populate a dictionary with needed values. The actual animation function runs a single frame of the animation and runs during an associated mode. Mode 0 is diamonds, 1 is party parrots and 2 is dancing lines. Mode 3 is an auto-play mode that randomly selects an animation to play.

## The Loop

The step switches are instantiated as a keypad object. This makes it easy to detect a press. The first switch changes the mode (`0`-`3`). The second switch changes the number of assets in each animation:

```python
diamond_count_options = [2, 4, 8]
party_count_options = [1, 4, 9, 16]
lines_count_options = [8, 12, 16, 20]
```

The potentiometer value is read and passed to each animation. This determines the noise floor sensitivity for the incoming sound.

```python
noise = simpleio.map_range(val(pot1), 0, 65535, 3.5, 1.5)

if mode == 0:
  diamonds(noise, read_pots)
elif mode == 1:
  party(noise, read_pots)
elif mode == 2:
  lines_pattern(noise, read_pots)
```

# Fruit Jam Video Music

## Wiring

![the electronic components knolled on a tabletop](https://cdn-learn.adafruit.com/assets/assets/000/139/758/medium800/circuitpython_edited_P1480161.jpg?1758141645 )

## Step Switches
Solder each step switch to a step switch breakout.

![the step switches with the pb86 breakout](https://cdn-learn.adafruit.com/assets/assets/000/139/759/medium640/circuitpython_edited_P1480166.jpg?1758141679)

![the step switches soldered to the breakouts](https://cdn-learn.adafruit.com/assets/assets/000/139/760/medium640/circuitpython_edited_P1480168.jpg?1758141695)

Solder headers to each end of the step switch breakouts.

![headers soldered to the step switch breakouts](https://cdn-learn.adafruit.com/assets/assets/000/139/761/medium640/circuitpython_edited_P1480171.jpg?1758141749)

## Perma-Proto
![](https://cdn-learn.adafruit.com/assets/assets/000/140/070/medium800/circuitpython_fruitJamVideoMusicPermaProto_bb.jpg?1759257155 )

The Perma-Proto board has rows labeled with letters and columns labeled with numbers. These labels will be referenced for part and wire placement.

Two [2x8 IDC breakout helpers](https://www.adafruit.com/product/2104) are soldered in the center of the Perma-Proto to plug into the Fruit Jam. The first pin on the first header is inserted into column 8. The first pin on the second header is inserted into column 16.

![2x16 header soldered to the center of the perma proto](https://cdn-learn.adafruit.com/assets/assets/000/139/762/medium640/circuitpython_edited_P1480180.jpg?1758141791)

### Ground

Cut and splice six pieces of black wire. These wires will be connected to ground. Insert and solder them into these locations on the Perma-Proto:

- **A2** to the **bottom ground rail**
- **A6** to the **bottom ground rail**
- **A10** to the **bottom ground rail**
- **A25** to the **bottom ground rail**
- **A29** to the **bottom ground rail**
- **J10** to the **top ground rail**

![the ground wires soldered to the perma proto](https://cdn-learn.adafruit.com/assets/assets/000/139/764/medium640/circuitpython_edited_P1480184.jpg?1758142043)

### 3.3V

Cut and splice one piece of red wire. This will carry 3.3V to the PDM mic. Insert and solder from&nbsp; **J9** to the **top positive rail**.

![the 3.3V wire soldered to the perma-proto](https://cdn-learn.adafruit.com/assets/assets/000/139/765/medium640/circuitpython_edited_P1480186.jpg?1758142207)

### Step Switch Input and LED+

Cut and splice two pieces of wire to connect the button and LED input on the first step switch.

- **B3** to **G11 (blue wire, normally open pin)**
- **A5** to **G12 (purple wire, LED+ pin)**

![the first step switch wires on the perma proto](https://cdn-learn.adafruit.com/assets/assets/000/139/767/medium640/circuitpython_edited_P1480189.jpg?1758142298)

Cut and splice two pieces of wire to connect the button and LED input on the second step switch.

- **B26** &nbsp;to **G13 (green wire, normally open pin)**
- **B28** to **G14 (orange wire, LED+ pin)**

![the wires for the second step switch soldered to the perma proto](https://cdn-learn.adafruit.com/assets/assets/000/139/768/medium640/circuitpython_edited_P1480191.jpg?1758142427)

Insert the step switches into the Perma-Proto. The first switch will have its **top common pin in I2** and its **bottom common pin in C2**. The second switch will have its **top common pin in I25** and its **bottom common pin in C25**. Solder them in place.

![the step switches soldered to the perma-proto](https://cdn-learn.adafruit.com/assets/assets/000/139/769/medium640/circuitpython_edited_P1480193.jpg?1758142503)

## PDM Mic

The PDM mic will connect to the Perma-Proto with a STEMMA QT cable.

Cut off the wire ends of a STEMMA QT cable. Splice the wires.

![a spliced stemma qt cable](https://cdn-learn.adafruit.com/assets/assets/000/139/770/medium640/circuitpython_edited_P1480196.jpg?1758142791)

Solder the STEMMA QT cable to the Perma-Proto board. This cable will plug into the PDM mic.

- **STEMMA QT positive** to the **top positive rail (red wire)**
- **STEMMA QT ground** to the **top negative rail (black wire)**
- **STEMMA QT clock** to **I16 (yellow wire)**
- **STEMMA QT data** to **I17 (blue wire)**

![the stemma qt cable soldered into the perma-proto](https://cdn-learn.adafruit.com/assets/assets/000/139/771/medium640/circuitpython_edited_P1480198.jpg?1758142835)

## Potentiometer

The potentiometer will be plugged into the A0 JST-PH port on the Fruit Jam.

Cut and splice the wire ends of a 3-pin JST-PH cable.

![a spliced 3 pin JST-PH cable](https://cdn-learn.adafruit.com/assets/assets/000/139/772/medium640/circuitpython_edited_P1480201.jpg?1758142971)

Solder the JST-PH cable to the potentiometer.

- **JST-PH ground** to **potentiometer ground (black wire)**
- **JST-PH data** to **potentiometer wiper (white wire)**
- **JST-PH positive** to **potentiometer positive (red wire)**

![a jst-ph cable soldered to a potentiometer](https://cdn-learn.adafruit.com/assets/assets/000/139/773/medium640/circuitpython_edited_P1480205.jpg?1758143259)

# Fruit Jam Video Music

## Assembly

![group shot of all of the components for the assembly](https://cdn-learn.adafruit.com/assets/assets/000/140/050/medium800/circuitpython_edited_P1480219.jpg?1759254450 )

## 3D Printed Stand-Offs
Attach the 3D printed stand-offs to the perma-proto board with M2.5 screws. The stand-offs have an edge that lines up with the side of the perma-proto.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/051/medium640/circuitpython_edited_P1480223.jpg?1759254503)

![](https://cdn-learn.adafruit.com/assets/assets/000/140/052/medium640/circuitpython_edited_P1480228.jpg?1759254512)

## Fruit Jam Sandwich
Insert the two 2x8 plug headers into the 2x16 socket header on the Fruit Jam.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/053/medium640/circuitpython_edited_P1480231.jpg?1759254585)

Plug the socket header on the perma-proto onto the plug headers in the Fruit Jam. The 3D printed stand-offs will align with the bottom mounting holes on the Fruit Jam.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/054/medium640/circuitpython_edited_P1480234.jpg?1759254621)

![](https://cdn-learn.adafruit.com/assets/assets/000/140/055/medium640/circuitpython_edited_P1480238.jpg?1759254694)

## Potentiometer JST-PH
Plug the JST-PH potentiometer cable into the A0 port on the Fruit Jam.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/056/medium640/circuitpython_edited_P1480241.jpg?1759254704)

## Case
Insert the Fruit Jam into the 3D printed case. Secure it with three M3 screws.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/057/medium640/circuitpython_edited_P1480243.jpg?1759254808)

Attach M2.5 stand-offs to the PDM microphone.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/058/medium640/circuitpython_edited_P1480248.jpg?1759254841)

Secure the PDM microphone in the enclosure with two M2.5 screws.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/059/medium640/circuitpython_edited_P1480252.jpg?1759254865)

## Lid
Attach the potentiometer to the case lid with its included nut.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/060/medium640/circuitpython_edited_P1480255.jpg?1759254891)

Attach the lid to the case with four M3 screws.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/061/medium640/circuitpython_edited_P1480258.jpg?1759254935)

## Finishing Touches
Secure the knurled knob to the potentiometer.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/062/medium640/circuitpython_edited_P1480261.jpg?1759254964)

That completes the assembly!

![](https://cdn-learn.adafruit.com/assets/assets/000/140/063/medium640/circuitpython_edited_P1480266.jpg?1759254991)

# Fruit Jam Video Music

## Use

https://youtu.be/bj8mEKabs0U

Plug the Fruit Jam DVI output into a monitor or TV. Then power the Fruit Jam with a USB-C power supply. You'll see the diamonds animation start up on the display.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/079/medium640/circuitpython_edited_P1480280.jpg?1759263027)

The mode switch changes the animation mode between diamonds, party parrots, dancing lines or play all. When play all is active, the LED on the switch stays lit.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/074/medium640thumb/circuitpython_modeSwitch.jpg?1759259299)

The count switch changes the number of assets on screen for the three different animations. In play all mode the asset count is randomized.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/075/medium640thumb/circuitpython_countButton.jpg?1759259400)

The potentiometer controls the trigger threshold for the animations. As you turn the potentiometer clockwise, the threshold is lowered and the animations will react at lower incoming audio volumes. When you turn it counter-clockwise, the threshold is raised and the animations will be less reactive.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/076/medium640thumb/circuitpython_knob.jpg?1759259561)


## 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)
### Step Switch with LED - Three Pack of Gray Plastic with Red LED

[Step Switch with LED - Three Pack of Gray Plastic with Red LED](https://www.adafruit.com/product/5498)
These hinged momentary step switches are evocative of the [16-step sequencer keys on TR-808 sythesizers](https://en.wikipedia.org/wiki/Roland_TR-808).&nbsp;Also sometimes used on A/V equipment, they're very tactile, with a good clicky feel. And of course, the built in red LED is...

In Stock
[Buy Now](https://www.adafruit.com/product/5498)
[Related Guides to the Product](https://learn.adafruit.com/products/5498/guides)
### PB86 Step Switch Breadboard-Friendly Breakout PCB - Pack of 12

[PB86 Step Switch Breadboard-Friendly Breakout PCB - Pack of 12](https://www.adafruit.com/product/5631)
A couple of months ago we started carrying [packs of colorful step switches](https://www.adafruit.com/product/5517)&nbsp;reminiscent of the [16-step sequencer keys on TR-808 synthesizers](https://en.wikipedia.org/wiki/Roland_TR-808). We gave folks the heads up that the...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5631)
[Related Guides to the Product](https://learn.adafruit.com/products/5631/guides)
### Panel Mount 10K potentiometer (Breadboard Friendly)

[Panel Mount 10K potentiometer (Breadboard Friendly)](https://www.adafruit.com/product/562)
This potentiometer is a two-in-one, good in a breadboard or with a panel. It's a fairly standard linear taper 10K ohm potentiometer, with a grippy shaft. It's smooth and easy to turn, but not so loose that it will shift on its own. We like this one because the legs are 0.2" apart...

In Stock
[Buy Now](https://www.adafruit.com/product/562)
[Related Guides to the Product](https://learn.adafruit.com/products/562/guides)
### Adafruit PDM Microphone Breakout with JST SH Connector

[Adafruit PDM Microphone Breakout with JST SH Connector](https://www.adafruit.com/product/4346)
An exotic new microphone has arrived in the Adafruit shop, a **PDM MEMS Microphone**! PDM is the 'third' kind of microphone you can integrate with electronics, apart from analog or I2S. These microphones are very commonly used in products, but are rarely seen in maker...

In Stock
[Buy Now](https://www.adafruit.com/product/4346)
[Related Guides to the Product](https://learn.adafruit.com/products/4346/guides)
### STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable

[STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable](https://www.adafruit.com/product/4209)
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 Dupont male 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...

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

[Pink and Purple Woven USB A to USB C Cable - 2 meters long](https://www.adafruit.com/product/5044)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also made for USB C for our modernized breakout boards, Feathers and more.&nbsp; [If you want something just like it but for Micro B, we have a B...](https://www.adafruit.com/product/4111)

Out of Stock
[Buy Now](https://www.adafruit.com/product/5044)
[Related Guides to the Product](https://learn.adafruit.com/products/5044/guides)
### Slim HDMI Cable - 900mm / 3 feet long

[Slim HDMI Cable - 900mm / 3 feet long](https://www.adafruit.com/product/2421)
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 914mm long (~3 feet). Sporting a&nbsp;teeny&nbsp;4mm diameter this cable stays out of your way!

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

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2421)
[Related Guides to the Product](https://learn.adafruit.com/products/2421/guides)

## Related Guides

- [Adafruit Fruit Jam](https://learn.adafruit.com/adafruit-fruit-jam.md)
- [Goose Game M4SK Controller](https://learn.adafruit.com/goose-game-m4sk-controller.md)
- [PyPortal Guitar Tuner](https://learn.adafruit.com/pyportal-guitar-tuner.md)
- [Robotic AI Bear using ChatGPT](https://learn.adafruit.com/robotic-ai-bear-using-chatgpt.md)
- [PyPortal Titano Weather Station](https://learn.adafruit.com/pyportal-titano-weather-station.md)
- [Stand for Feather ESP32 with Reverse TFT](https://learn.adafruit.com/stand-for-feather-esp32-with-reverse-tft.md)
- [Pi SSD Media Server](https://learn.adafruit.com/pi-ssd-media-server.md)
- [CircuitPython OctoPrint Controller and Monitor](https://learn.adafruit.com/circuitpython-octoprint-controller-and-monitor.md)
- [RGB LED Matrix Cube with 25,000 LEDs](https://learn.adafruit.com/rgb-led-matrix-cube-for-pi.md)
- [LLM Agent Embodiment Kit](https://learn.adafruit.com/llm-agent-embodiment-kit.md)
- [Kitty Toe Bean Keypad with Color TFT](https://learn.adafruit.com/kitty-toe-bean-paw-keypad-color-tct.md)
- [Walkmellotron: Cassette Player Mods](https://learn.adafruit.com/walkmellotron.md)
- [reef-pi Guide 4: Water Level Controller](https://learn.adafruit.com/reef-pi-water-level-controller.md)
- [Personal and Portable ESP32-S2 Web Server](https://learn.adafruit.com/wordle-personal-esp32-s2-web-server.md)
- [Split Ortho Keyboard with TCA8418 Matrix Expanders](https://learn.adafruit.com/split-ortho-keyboard.md)
- [ESP32-S3 BLE RS-232 Controller](https://learn.adafruit.com/esp32-s3-ble-rs232-controller.md)
