# Demofruit: Demoscene for Fruit Jam

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/144/928/medium800/hacks_crtdemo3.jpg?1784679922)

https://youtu.be/fEbpPD9Ned8

![](https://cdn-learn.adafruit.com/assets/assets/000/144/850/medium800/hacks_menu1.png?1784082231)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/898/medium800/hacks_df2.jpg?1784334304)

 **Demofruit** is a love letter to the C64/Amiga/DOS graphics and music demoscene of the 1980s and 90s, built to run on the Fruit Jam. Six classic demoscene effects have been ported using Claude Opus 4.8 to run in Arduino on the RP2350-based Fruit Jam

- **Starfield** forward-warping star field with bouncing text
- **Plasma** palette cycled summed sine waves
- **Chrome Sphere** a dual-core raytraced renderer
- **Valley Run** wireframe terrain flyover is a nod to the vector-landscape demos
- **Rotozoom** - tiling bitmap texture tranforms with rotation and scaling and lens effect
- **The Juggler** - port of Eric Graham's 1987 Amiga Juggler raytracer — an animated character&nbsp;juggling three mirrored balls over a checkered floor

All of the demos (and the launcher screen) are accompanied by tracker MOD songs created by **kqvc** that playback using the PocketMod MOD player.

![](https://cdn-learn.adafruit.com/assets/assets/000/144/929/medium800/hacks_crtdemo2.jpg?1784679959)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/930/medium800/hacks_crtdemo4.jpg?1784679972)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/931/medium800/hacks_crtdemo5.jpg?1784679980)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/855/medium800/hacks_valley1.png?1784082342)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/932/medium800/hacks_crtdemo6.jpg?1784679989)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/933/medium800/hacks_crtdemo9.jpg?1784680002)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/934/medium800/hacks_crtdemo10.jpg?1784680009)

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

In 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
### USB Powered Speakers

[USB Powered Speakers](https://www.adafruit.com/product/1363)
Add some extra boom to your audio project with these powered loudspeakers. We sampled half a dozen different models to find ones with a good frequency response, so you'll get quality audio output for music playback. Simply connect the standard 3.5mm stereo plug into your Raspberry Pi model...

In Stock
[Buy Now](https://www.adafruit.com/product/1363)
[Related Guides to the Product](https://learn.adafruit.com/products/1363/guides)
![Two square-ish USB Powered Speakers](https://cdn-shop.adafruit.com/640x480/1363-07.jpg)

Featured
### 7" Display 1280x800 (720p) IPS + Speakers - HDMI/VGA/NTSC/PAL

[7" Display 1280x800 (720p) IPS + Speakers - HDMI/VGA/NTSC/PAL](https://www.adafruit.com/product/1667)
Yes, this is an adorable small HDMI television with incredibly high resolution **and built in 3W stereo speakers**! We tried to get the smallest possible HDMI/VGA display with high-res, high-contrast visibility. The visible display measures only 7" (17.8cm) diagonal, and the TFT comes...

In Stock
[Buy Now](https://www.adafruit.com/product/1667)
[Related Guides to the Product](https://learn.adafruit.com/products/1667/guides)
![Front view of assembled and powered on HDMI 4 Pi - 7" Display. The monitor displays a desktop background with a raspberry logo.](https://cdn-shop.adafruit.com/640x480/1667-00.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
### 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)

Featured
### Official Raspberry Pi Power Supply 5.1V 3A with USB C

[Official Raspberry Pi Power Supply 5.1V 3A with USB C](https://www.adafruit.com/product/4298)
The official Raspberry Pi USB-C power supply is here! And of course, we have 'em in classic Adafruit black! Superfast with just the right amount of cable length to get your Pi 4 projects up and running!

Best for use with Pi 4 series, [Pi...](https://www.adafruit.com/product/5814)

In Stock
[Buy Now](https://www.adafruit.com/product/4298)
[Related Guides to the Product](https://learn.adafruit.com/products/4298/guides)
![Angled shot of Official Raspberry Pi Power Supply 5.1V 3A with USB C with Power plug facing down. ](https://cdn-shop.adafruit.com/640x480/4298-04.jpg)

# Demofruit: Demoscene for Fruit Jam

## Intro to Demoscene

> From [Wikipedia](https://en.wikipedia.org/wiki/Demoscene), the free encyclopedia
> 
> The&nbsp; **demoscene** &nbsp;is an international&nbsp;[computer art](https://en.wikipedia.org/wiki/Computer_art "Computer art")&nbsp;[subculture](https://en.wikipedia.org/wiki/Subculture "Subculture")&nbsp;focused on producing&nbsp; **demos** : self-contained, sometimes extremely small, computer programs that produce&nbsp;[audiovisual](https://en.wikipedia.org/wiki/Audiovisual "Audiovisual")&nbsp;presentations. The purpose of a demo is to show off&nbsp;[programming](https://en.wikipedia.org/wiki/Computer_programming "Computer programming"), visual art, and musical skills. Demos and other demoscene productions (graphics, music, videos, games) are shared, voted on and released online at festivals known as&nbsp;[demoparties](https://en.wikipedia.org/wiki/Demoscene#Parties).
> 
> The scene started with the&nbsp;[home computer](https://en.wikipedia.org/wiki/Home_computer "Home computer")&nbsp;revolution of the early 1980s, and the subsequent advent of&nbsp;[software cracking](https://en.wikipedia.org/wiki/Software_cracking "Software cracking").<sup id="cite_ref-1" class="mw-ref reference"></sup>&nbsp;Crackers altered the code of&nbsp;[computer games](https://en.wikipedia.org/wiki/Computer_game "Computer game")&nbsp;to remove copy protection, claiming credit by adding introduction screens of their own ("[cracktros](https://en.wikipedia.org/wiki/Crack_intro "Crack intro")"). They soon started competing for the best visual presentation of these additions.<sup id="cite_ref-WiderScreen_2014-04-15_2-0" class="mw-ref reference"></sup>&nbsp;Through the making of intros and stand-alone demos, a new community eventually evolved, independent of the gaming<sup id="cite_ref-reunanen2010_3-0" class="mw-ref reference"></sup><sup id="mwLQ" class="reference nowrap"><span title="Page / location: 29–30"><span> </span></span></sup>&nbsp;and&nbsp;[software sharing](https://en.wikipedia.org/wiki/Warez_scene "Warez scene")&nbsp;scenes.

https://youtu.be/iw17c70uJes?si=wBUX_ZFvjJ6qxlE-

## Starfield Effect

The classic space demo -- 3D points using a perspective projection to calculate 3D depth of 2D point coordinates.

![](https://cdn-learn.adafruit.com/assets/assets/000/144/858/medium640/hacks_star2.png?1784083838)

## Plasma Effect

> Plasma is the name of a&nbsp;[VGA](https://en.wikipedia.org/wiki/VGA "VGA")&nbsp;graphics demo created by Bret Mulvey in 1988 and released on&nbsp;[CompuServe](https://en.wikipedia.org/wiki/CompuServe "CompuServe"). It uses a&nbsp;[diamond-square algorithm](https://en.wikipedia.org/wiki/Diamond-square_algorithm "Diamond-square algorithm")&nbsp;to generate a 2D pattern, and then cycles the colors using hardware palette in its 256-color mode.

![](https://cdn-learn.adafruit.com/assets/assets/000/144/857/medium640/hacks_plasma2.png?1784083599)

## Chrome Ball Raytracer

A dual-core raytracer: a reflective chrome sphere orbiting over a cream-and-red&nbsp;checkerboard, with specular highlights, and a shadow. Core 1 renders while core 0 upscales and blits.

![](https://cdn-learn.adafruit.com/assets/assets/000/144/859/medium640/hacks_ray1.png?1784084014)

## Vector Valley aka Fractal Landscape

Continuously scrolling grid of wireframe 3D terrain moving toward camera.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/144/860/medium640/hacks_valley2.png?1784084097)

## Rotozoom

2D image/texture effect with continuously rotating and scaling image. Added complexity with a magnifying glass effect superimposed over a region.

![](https://cdn-learn.adafruit.com/assets/assets/000/144/861/medium640/hacks_roto2.png?1784084268)

## Amiga Juggler Demo

From [Wikipedia](https://en.wikipedia.org/wiki/Sculpt_3D):

> **Sculpt 3D** &nbsp;is a&nbsp;[raytrace](https://en.wikipedia.org/wiki/Ray_tracing_(graphics) "Ray tracing (graphics)")&nbsp;application released in 1987 for&nbsp;[Amiga](https://en.wikipedia.org/wiki/Amiga "Amiga") computers programmed by Eric Graham.<sup id="cite_ref-1" class="mw-ref reference"></sup>&nbsp;Sculpt 3D was one of the first&nbsp;[ray tracing](https://en.wikipedia.org/wiki/Ray_tracing_(graphics) "Ray tracing (graphics)")&nbsp;applications released for the Amiga computers. It proved that raytracing could be done on&nbsp;[home computers](https://en.wikipedia.org/wiki/Home_computer "Home computer")&nbsp;as well as on&nbsp;[mainframes](https://en.wikipedia.org/wiki/Mainframe "Mainframe").
> 
> The first demo that showed the raytracing capabilities was an&nbsp;[animation](https://en.wikipedia.org/wiki/Animation "Animation")&nbsp;of a&nbsp;[juggler](https://en.wikipedia.org/wiki/Juggler "Juggler")&nbsp;juggling three chrome balls. Even though the juggler was constructed out of spheres, the balls' reflections and movement made it look realistic. The juggler demo was generated on an experimental version of Sculpt 3D. The animation, released in January 1986, generated so much interest that the full 3D application was programmed.

![](https://cdn-learn.adafruit.com/assets/assets/000/144/862/medium640/hacks_jug4.png?1784084349)

# Demofruit: Demoscene for Fruit Jam

## Demofruit Installation and Use

## Software Installation

Head here first to&nbsp;[download the latest release UF2 of Demofruit for Fruit Jam](https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Demofruit/build/rp2040.rp2040.adafruit_fruitjam/demofruit.ino.uf2).

## Enter RP2350 bootloader mode

Entering the RP2350 bootloader is easy. Complete the following steps.

**Before you start, make sure your Fruit Jam is plugged into USB port to your computer using a data/sync cable.** &nbsp;Charge-only cables will not work!

**Turn on the On/Off switch** &nbsp;- check that you see the ON light on so you know the board is powered.

To enter the bootloader:

1. **Press and hold the BOOT/BUTTON1 button down.** &nbsp;Don't let go of it yet!
2. **Press and release the Reset button.** &nbsp;You should still have the BOOT/BUTTON1 button pressed while you do this.
3. **Continue holding the BOOT/BUTTON1 button until you see the RP2350 drive appear.**  
4. You can now release but BOOT/BUTTON1 button.

## Drag UF2

Navigate to the folder where you downloaded the&nbsp; **uf2** &nbsp;file, then drag it onto the RP2350 drive.

The board will automatically reboot and Demofruit will launch automatically.

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

![](https://cdn-learn.adafruit.com/assets/assets/000/144/849/medium800/hacks_menu.png?1784081602)

## Fruit Jam Connections

Plug in an HDMI cable to the Fruit Jam's DVI-D Video Output port, then plug the other end of the cable into an HDMI display.

Plug in a 3.5mm TRS cable to the Fruit Jam's Stereo Headphone jack, and then plug the other end into a set of powered speakers.

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

## Play Demos

You can use the Fruit Jam's buttons to navigate the Demofruit menu. Directions are listed on the main page:

- Button #3 = Up
- Button #2 = Down
- Button #1 = Launch
- Reset = Quit a demo and go back to menu screen

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

https://youtu.be/6XLhmlkYBBA

## Starfield

A forward-warping star field with per-letter bouncing chrome text. The classic "space + scroller" demo opener.

- Button1 — cycle the text message (``Adafruit``, ``Fruit Jam``, ``kqvc``,  
&nbsp; ``L 4 r 5 5 5``; editable at the top of&nbsp; **starfield\_impl.h** )
- Button2 — step warp intensity
- Button3 — randomize star density

![](https://cdn-learn.adafruit.com/assets/assets/000/144/883/medium640/hacks_menu.png?1784326911)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/884/medium640/hacks_star3.png?1784326923)

## Plasma

Palette-cycled plasma — smoothly morphing colored blobs generated from summed sine waves. Originally used the RP2350's hardware palette (DVHSTX8); in the sampler it renders through the shared 16-bit display via a software palette LUT.

- Button1 — cycle palette (Fire / Ice / Toxic / Lava / Rainbow)
- Button2 — toggle palette-rotation vs. full-animate mode
- Button3 — randomize wave frequencies and drift (can produce very large,&nbsp; slow cells)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/885/medium640/hacks_menu1.png?1784327052)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/886/medium640/hacks_plasma2.png?1784327068)

## Chrome Sphere

A dual-core raytracer: a reflective chrome sphere orbiting over a cream-and-red checkerboard, with specular highlights and a shadow. Core 1 renders while core 0 upscales and blits.

- Button1 — randomize light angle
- Button2 — randomize camera height
- Button3 — randomize camera distance

![](https://cdn-learn.adafruit.com/assets/assets/000/144/887/medium640/hacks_menu2.png?1784327187)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/888/medium640/hacks_ray1.png?1784327209)

## Valley Run

A wireframe trench flythrough with a flat-shaded fighter ship strafing and banking through it — a nod to the vector-landscape demos and to Star Fox.

- Button1 — cycle wire color (ship auto-picks the complementary color)
- Button2 — step scroll speed (5 presets)
- Button3 — randomize terrain

![](https://cdn-learn.adafruit.com/assets/assets/000/144/889/medium640/hacks_menu3.png?1784327362)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/890/medium640/hacks_valley1.png?1784327492)

## Rotozoom

A tiling bitmap rotating and scaling in real time (a "rotozoomer"), with a blue-tinted spherical lens bubble drifting over it in a Lissajous orbit. Uses fixed-point math and dual-core rendering. The source bitmap is a 128×128 image baked into `texture.h` (see "Creating the rotozoom image" below).

- Button1 — cycle motion preset (Normal / Fast / Reverse / Slow Drift /  
&nbsp; Zoom Frenzy)
- Button2 — toggle the lens
- Button3 — randomize the zoom range

![](https://cdn-learn.adafruit.com/assets/assets/000/144/891/medium640/hacks_menu4.png?1784327691)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/892/medium640/hacks_roto4.png?1784327715)

## The Juggler

A port of Eric Graham's 1987 Amiga \*Juggler\* raytracer — a robotic figure juggling three mirrored balls over a checkered floor. The original took about an hour per frame on a 7 MHz 68000; the Fruit Jam renders a frame in about 1.5 seconds.

On launch it raytraces 24 frames of a juggling cycle into PSRAM (watch the "venetian blind" render, ~20 seconds, both cores working), then loops smooth playback forever — the same render-then-playback architecture as Graham's original `movie` player.

- Button1 — slower playback
- Button2 — faster playback (3/6/12/18/24/30 fps)
- Button3 — pause / resume

![](https://cdn-learn.adafruit.com/assets/assets/000/144/893/medium640/hacks_menu5.png?1784327746)

![](https://cdn-learn.adafruit.com/assets/assets/000/144/894/medium640/hacks_jug4.png?1784327762)

# Demofruit: Demoscene for Fruit Jam

## Customization

Demofruit is written in Arduino, so if you want to customize it go ahead and use the information on the next couple of pages to install Arduino IDE and set it up for use with the Fruit Jam.

## Texture Conversion

The Rotozoom demo tiles and spins a 128×128 pixel source image stored in **texture.h** as an RGB565 array.

&nbsp;Image requirements:

- 128×128 pixels (power-of-two - the demo wraps with a fast bitwise mask, `TEXTURE_MASK 0x7F`, instead of division)
- 24-bit uncompressed BMP (Windows/DIB), no alpha, no RLE
- Bold, high-contrast content — thick shapes, chunky patterns, or a strong central subject. Concentric shapes, mandalas, chunky pixel art, or a bold face/logo all work well.

### Making the BMP

Any image editor works — Photoshop, GIMP, Affinity, Procreate, Pixelmator. Create or resize to 128×128 and export/save as BMP, 24-bit, uncompressed.

&nbsp;Converting the BMP **to texture.h**

The helper script, **bmp2texture.py** , bakes the image into the C header the sketch expects. It reads the BMP, handles its bottom-up row order, converts each pixel to RGB565, and writes the `texture[128][128]` array with the `TEXTURE_W`, `TEXTURE_H`, and `TEXTURE_MASK` defines.

`python3 bmp2texture.py yourimage.bmp texture.h`

The second argument is optional and defaults to **texture.h**. The script validates its input and will refuse anything that isn't a 128×128, 24-bit, uncompressed BMP — with a message telling you what to fix (wrong size, wrong bit depth, or compression enabled). Overwrite the project's **texture.h** with your converted version and recompile to change the rotozoom image.

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

## Music

Each demo (and the menu) has its own soundtrack, played as a ProTracker MOD file. MODs are the native music format of the demoscene: a small bank of digitized instrument samples plus pattern data describing which sample plays at what pitch on each channel.

Playback uses pocketmod, an MIT-licensed MOD player, which renders the music in real time on core 0. The audio path is:

pocketmod mixes stereo float samples → converted to 16-bit → sent to the TLV320DAC3100 codec over I2S (via the RP2350's PIO + DMA).

Songs live in the sketch as C headers, one per slot:

Each header contains a `MOD_DATA` byte array; the sketch wraps each in its own namespace so they don't collide. pocketmod supports up to 32 channels, so 6-channel, 8-channel, and wider MODs play fine (not just 4-channel) — though authentic 4-channel MODs are the period-correct choice and mix with the least CPU. If a song fails to load, the sketch logs the failure and simply runs silent rather than crashing.

### Converting your own MOD files

A helper script, **mod2header.py** , converts any ProTracker .mod file into the header format the sketch expects. It does a straight byte-to-array conversion — it does not alter the music.

`python3 mod2header.py yoursong.mod song_4.h`

The second argument is optional; if omitted it writes **yoursong.h**. To change a demo's music, convert your MOD directly to the matching **song\_N.h** , then recompile. To change the menu music, target **song\_0.h**.

### Where to find MODs

- [The Mod Archive](modarchive.org)&nbsp; filter by license and by file size (leaner tracks make smaller headers and faster compiles)
- Compose your own in a tracker such as MilkyTracker runs natively on macOS, Windows, and Linux

&nbsp;Notes on file size and editing

The bulk of a MOD's size is its sample data, not its pattern/song length. To shrink a header:

- In a tracker, the biggest lever is downsampling the largest samples in the Sample Editor (roughly halves their size per octave of rate reduction);&nbsp; trimming silence and tightening loops also helps.
- Shortening the order list (how many patterns play in sequence) plus deleting the now-unused patterns/samples reduces size only modestly, but is the right tool for fitting a track's \*length\* to a demo.

**pocketmod** loops a MOD automatically at its end, so a clean loop point often matters more than absolute length. Whatever you edit, listen to the loop seam (play to the end and let it wrap) before converting to a header.

### Speaker Easter Egg

The onboard speaker port on the Fruit Jam is muted by default; the headphone jack always works. To enable the speaker: connect the A1 pad (GPIO41) on the GPIO header to GND with a jumper wire, then reset/power on the board.

To mute it: remove the jumper and reset.

The jumper is read once at startup (with an internal pull-up: tied to GND = speaker on, left open = muted), and the state is printed to the serial monitor. The speaker connector needs the board powered from 5 V to be audible.

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

# Demofruit: Demoscene for Fruit Jam

## Arduino IDE Setup

The [**Arduino**  **Philhower core**](https://github.com/earlephilhower/arduino-pico) provides support for RP2350 microcontroller boards. This page covers getting your Arduino IDE set up to include your board.

## Arduino IDE Download

The first thing you will need to do is to download the latest release of the Arduino IDE. The Philhower core requires **version 1.8** &nbsp;or higher.

[Arduino IDE Download](https://www.arduino.cc/en/software)
Download and install it to your computer.

Once installed, open the Arduino IDE.

## Adding the Philhower Board Manager URL

In the Arduino IDE, and navigate to the **Preferences** window. You can access it through **File \> Preferences** on Windows&nbsp;or&nbsp;Linux, or **Arduino \> Preferences** on OS X.

The **Preferences** window will open.

In the **Additional Boards Manager URLs** field, you'll want to add a new URL. The list of URLs is comma separated, and&nbsp;_you will only have to add each&nbsp;URL once._ The URLs point to index files that the Board Manager uses to build the list of available & installed boards.

Copy the following URL.

`https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json`

Add the URL to the the **Additional Boards Manager URLs** field (highlighted in red below). If you already have a board support package in that field, type a comma at the end then add the address above. Both will then be loaded by the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/121/medium800/rp2040_arduino_ide_setup_Arduino_Template_preferences_window.png?1638917398)

Click **OK** to save and close **Preferences**.

## Add Board Support Package

In the Arduino IDE, click on **Tools \> Board \> Boards Manager**. If you have previously selected a board, the **Board** menu item may have a board name after it.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/263/medium800/rp2350_arduino_ide_setup_Untitled1b.png?1759870930)

In the **Boards Manager** , search for RP2040. Scroll down to the **Raspberry Pi Pico/RP2040/RP2350 by Earle F Philhower, III** entry. Click **Install** to install it.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/262/medium800/rp2350_arduino_ide_setup_b.png?1759870897)

Warning: 

Once installation is complete, click **Close** to close the Boards Manager.

## Choose Your Board

In the **Tools \> Boards** menu, you should now see **Raspberry Pi RP2040/RP2350 Boards (in sketchbook)**.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/264/medium800/rp2350_arduino_ide_setup_Untitled1a.png?1759870955)

Navigate to the **Raspberry Pi RP2040/RP2350 Boards** menu. You will see the available boards listed.

In the **Raspberry Pi Pico/RP2040/RP2350 Boards** menu choose&nbsp; **Adafruit Fruit Jam RP2350**.

![Aruino IDE with the Tools -> Boards menu open showing Raspberry Pi Pico/RP2040/RP2350 and then Adafruit Fruit Jam RP2350 selected](https://cdn-learn.adafruit.com/assets/assets/000/138/822/medium800/adafruit_products_fruit_jam_arduino_board_select.png?1754497742 )

Danger: If there is no serial Port available in the dropdown, or an invalid one appears - don't worry about it! The RP2350 does not actually use a serial port to upload, so its OK if it does not appear if in manual bootloader mode. You will see a serial port appear after uploading your first sketch.

Now you're ready to begin using Arduino with your RP2350 board!

# Demofruit: Demoscene for Fruit Jam

## Code the Fruit Jam

If you want to customize the Demofruit or just have a look at the code, download the Project Bundle linked below.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Demofruit/Demofruit.ino

## How It Works

Each demo began as a standalone sketch and was merged into the sampler launcher. They are listed here in menu order, which is also roughly chronological by technique.

Because the each demo uses a slightly different display configuration, and the DVI HSTX library display object is constructed once at startup, Demofruit uses a reboot launcher. This is a similar technique multi-part Amiga demos used to chain-load segments.

On power-up or after pressing **reset** , no launch flag is set, so the sketch shows the menu. This includes a tumbling, 3D cube behind green text, with the cube tinted to the highlighted demo's signature color.

### Menu navigation

- Button 3 = up
- Button 2 = down
- Button 1 = launch

Selecting a demo writes its ID plus a magic number into the RP2350's watchdog scratch registers (which survive a soft reboot) and triggers a watchdog reboot.

On the next boot the sketch sees the flag, immediately clears it, and constructs that demo's ideal display and runs it forever. Because the flag was cleared at demo start, pressing \*\*Reset\*\* returns you to the menu.

The NeoPixel strip reinforces the UI throughout: in the menu it glows the highlighted demo's signature color; inside a demo it shows the current setting (e.g. Valley Run lights \*N\* of 5 pixels for the speed preset, in the current wire color). Pixel order is top-to-bottom. A brief blink acknowledges "randomize"-type buttons that have no persistent state to display.

## Starfield

The star field is one of the oldest tricks in the demo scene, and it works through a bit of faked perspective. Each star is really just a point with an X, Y, and Z position, where Z represents how far away it is. To draw a star, the code divides its X and Y by its Z: distant stars (large Z) get pulled in close to the center of the screen and drawn small, while near stars (small Z) spread out toward the edges and grow large.&nbsp;

To create the sense of flying forward, every frame simply decreases each star's Z a little. As Z shrinks, that division makes the star rush outward and accelerate, and when it passes the viewer it gets recycled to a new random position far away. That single divide per star is the whole illusion of three-dimensional motion.

On the Fruit Jam this runs at full frame rate because the math is so simple, which leaves plenty of room for the bouncing chrome text layered on top. Rather than allocating memory for each letter, the code reads the font's pixel data directly from the Fruit Jam's flash and plots the glyphs over the moving field, letting them bob and scale independently. The result is the classic "warp speed plus scroller" opener that demos have used for decades.

## Plasma

This effect comes from adding several sine waves together — one that varies across the screen horizontally, one vertically, one along the diagonal, and one radiating from a center point. Where those waves reinforce each other you get bright values; where they cancel, dark ones. Summed across every pixel, the overlapping ripples produce those signature organic, lava-lamp blobs. The demoscene's key insight was that you do not need to recompute all that trigonometry every frame. Instead you precompute the wave values into tables once, then animate purely by sliding color-lookup offsets through those tables, a cheap addition instead of expensive sine calls.

The Fruit Jam version keeps that period-authentic approach. It builds the wavetables at startup and, in its lightest mode, animates by rotating a 256-entry color palette rather than touching the image at all.&nbsp;

The original Amiga and VGA effects leaned on hardware palette registers to do this for free; the Fruit Jam instead keeps an 8-bit index map and translates it through a software color lookup table into the 16-bit RGB565 values the display wants.&nbsp;

That software palette pass is so fast on the RP2350 that the demo also offers a fuller mode where the wave map itself is recomputed every frame, letting the plasma physically writhe and drift rather than just cycle colors.

## Chrome Sphere

This demo is a real raytracer, the same fundamental technique used to render photorealistic 3D images. For every pixel on the screen, it casts an imaginary ray out from the camera into the scene and asks what that ray hits. If it strikes the checkered floor, the code works out which check square it landed in and shades it accordingly. If it strikes the chrome sphere, the ray bounces, it reflects off the surface and continues on to see what the sphere would be mirroring, which is what gives the ball its shiny, reflective look. The code also traces a second ray from each floor point toward the light to decide whether that spot sits in the sphere's shadow. Raytracing was far too slow for real-time animation in the demoscene era, which is exactly why doing it live here is satisfying.

The Fruit Jam pulls this off by putting both of the RP2350's processor cores to work. The chip has two cores, and this demo hands half the image to each: they raytrace alternating rows of the frame simultaneously, roughly doubling the speed. To keep the frame rate smooth, the scene is traced at a reduced resolution and scaled up to fill the display. As you press the buttons to move the light and camera, the new values are shared between the cores so both stay in sync, and the whole reflective, shadowed scene re-renders continuously in real time.

## Valley Run

Valley Run is a flat-shaded 3D fly through in the spirit of the vector landscape demos and games like Star Fox. The trench is a mesh of points laid out in a grid, scrolling toward you to create forward motion. Each of those 3D points is projected onto the 2D screen using the same perspective divide the star field uses: divide by distance so far parts of the trench converge toward a vanishing point. The walls are drawn as wireframe lines connecting the grid, and the fighter ship is built from a handful of triangular faces. Each face is "flat shaded," meaning the code calculates how directly it faces the light and fills the whole triangle with a single brightness, giving that crisp, faceted, low-poly look without the cost of smooth shading.

Because the geometry is simple, the Fruit Jam renders the whole scene on a single core with cycles to spare. The ship's motion is more than decoration: it's knee-like banking and side-to-side strafing are computed each frame, so it leans into its movement naturally. A subtle animation also runs along the trench walls so the corridor appears to breathe as it scrolls. The buttons let you change the wire color, step through five scroll speeds, and randomize the terrain's height and roughness on the fly.

## Rotozoom

A "rotozoomer" takes a flat image and rotates and scales it in real time while tiling it infinitely across the screen, and it was a demoscene staple because it looks far more computationally expensive than it actually is. The trick is to work backwards. Instead of asking "where does each pixel of my image end up on screen," the code asks, for every screen pixel, "which pixel of the source image belongs here?" It walks across the screen stepping through the source image at an angle and scale determined by the current rotation and zoom. When the coordinates run off the edge of the 128x128 source, they simply wraparound, which is what tiles the pattern seamlessly. Crucially, this stepping is done with fixed-point math — numbers that use integer arithmetic to represent fractions — because integer operations were, and on a microcontroller still are, much faster than floating point for this kind of per-pixel work.

The Fruit Jam version tiles a 128x128 texture whose power-of-two size lets the wrap-around happen with a single fast bitwise mask instead of a division. Both processor cores share the work of filling the screen. On top of the spinning texture, a translucent "lens" bubble drifts around in a looping orbit, magnifying and blue-tinting whatever is beneath it by resampling those pixels through a spherical distortion, a little flourish that shows off how cheap the underlying sampling really is. You can cycle motion presets, toggle the lens, and randomize the zoom range with the buttons.

## The Juggler

The Juggler is a piece of computer graphics history. In 1986, Eric Graham created a raytraced animation of a robot juggling three mirrored balls to showoff what the new Commodore Amiga could do, and it became one of the most famous demos of its era. The catch was that each frame took the Amiga's 7 MHz processor around an hour to raytrace, so Graham rendered the frames ahead of time and then played them back in sequence like a movie. This demo is a faithful port of Graham's original 1987 raytracer code, right down to how it bounces rays off the reflective spheres and the checkered floor, with its recursion depth capped so mirror-in-mirror reflections terminate cleanly.

Demofruit follows Graham's exact strategy of render-first, play-later, just way faster. When you launch the demo, both cores of the RP2350 raytrace 24 frames of a full juggling cycle and store them in the Fruit Jam's 8 MB of PSRAM — you can watch the image build in a "venetian blind" pattern as the two cores fill alternating rows, which takes about 20 seconds. Once all 24 frames are cached, the demo plays them back in a smooth loop, and the buttons let you change the playback speed or pause. A single frame that took Graham's Amiga roughly an hour now renders in about a second and a half. The juggling motion itself — a proper three-ball cascade, with the figure's knees bending and body shifting its weight — was recreated for this port, since the original animation data was never part of the published source code.


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

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

[USB Powered Speakers](https://www.adafruit.com/product/1363)
Add some extra boom to your audio project with these powered loudspeakers. We sampled half a dozen different models to find ones with a good frequency response, so you'll get quality audio output for music playback. Simply connect the standard 3.5mm stereo plug into your Raspberry Pi model...

In Stock
[Buy Now](https://www.adafruit.com/product/1363)
[Related Guides to the Product](https://learn.adafruit.com/products/1363/guides)
### 7" Display 1280x800 (720p) IPS + Speakers - HDMI/VGA/NTSC/PAL

[7" Display 1280x800 (720p) IPS + Speakers - HDMI/VGA/NTSC/PAL](https://www.adafruit.com/product/1667)
Yes, this is an adorable small HDMI television with incredibly high resolution **and built in 3W stereo speakers**! We tried to get the smallest possible HDMI/VGA display with high-res, high-contrast visibility. The visible display measures only 7" (17.8cm) diagonal, and the TFT comes...

In Stock
[Buy Now](https://www.adafruit.com/product/1667)
[Related Guides to the Product](https://learn.adafruit.com/products/1667/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)
### 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)
### Official Raspberry Pi Power Supply 5.1V 3A with USB C

[Official Raspberry Pi Power Supply 5.1V 3A with USB C](https://www.adafruit.com/product/4298)
The official Raspberry Pi USB-C power supply is here! And of course, we have 'em in classic Adafruit black! Superfast with just the right amount of cable length to get your Pi 4 projects up and running!

Best for use with Pi 4 series, [Pi...](https://www.adafruit.com/product/5814)

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

## Related Guides

- [Adafruit Fruit Jam](https://learn.adafruit.com/adafruit-fruit-jam.md)
- [Interactive Map with Circuit Playground Express](https://learn.adafruit.com/interactive-map-with-cpx.md)
- [Edge-Lit Tavern Sign with WLED - Control with WiFi or IR Remote](https://learn.adafruit.com/edge-lit-tavern-sign-with-wled-control-with-wifi-or-ir-remote.md)
- [MEMENTO Focus Stacking](https://learn.adafruit.com/memento-focus-stacking.md)
- [Egg Hunt Maze Game on Fruit Jam](https://learn.adafruit.com/egg-hunt-maze-game-on-fruit-jam.md)
- [PyPortal Pet Planter with Adafruit IO](https://learn.adafruit.com/pyportal-pet-planter-with-adafruit-io.md)
- [WiFi Jellyfish Lantern with WLED](https://learn.adafruit.com/wifi-jellyfish-lantern-with-wled.md)
- [Track a Turtle with WipperSnapper](https://learn.adafruit.com/track-a-turtle-with-wippersnapper.md)
- [Adafruit BrainCraft HAT - Easy Machine Learning for Raspberry Pi](https://learn.adafruit.com/adafruit-braincraft-hat-easy-machine-learning-for-raspberry-pi.md)
- [Matrix Portal New Guide Scroller](https://learn.adafruit.com/matrix-portal-new-guide-scroller.md)
- [Sampling Keyboard with Fruit Jam](https://learn.adafruit.com/sampling-keyboard-with-fruit-jam.md)
- [Velociraptor Voice and Eye Upgrade with MONSTER M4SK](https://learn.adafruit.com/hand-puppet-voice-and-eye-upgrade-with-monster-m4sk.md)
- [Grand Central Soundboard in Ten Minutes](https://learn.adafruit.com/grand-central-soundboard-in-ten-minutes.md)
- [Lightsaber Prop-Maker RP2040](https://learn.adafruit.com/lightsaber-rp2040.md)
- [MagTag Slideshow](https://learn.adafruit.com/magtag-slideshow.md)
- [Close Encounters of the MIDI NeoPixel Visualizer Kind](https://learn.adafruit.com/midi-neopixel-visualizer.md)
