# A Floppy Thumb Drive with a Color File Icon Display

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/118/831/medium800thumb/lcds___displays_600.jpg?1677119919)

The moment folks look at this project, they get both nostalgic and confused at the same time. It is, almost, what it appears to be: a floppy disk shaped item ("the save icon" to the young ones) with a color display showing what files are contained within.

With classic floppies, we always wanted to know which files were on a disk - this shows the files rather than having a paper label.

This project is a functional storage device with a display. It is a solid state device with 8MB of storage transferable via USB. You can store your files in style and have an interesting item to show your friends and colleagues (and confuse the kids).

This is a fun no solder project realized with CircuitPython.

## Inspiration
The 19A0s (not a typo) was a wild decade for design. Vividly described by Boing Boing and Reddit, the 19A0s saw the creation of fabulous art, culture, and technology which was not present in other decades of the 20th century.&nbsp;

A [Boing Boing article](https://boingboing.net/2021/07/13/lokis-retro-tech-world-is-the-best-19a0.html) on the technology in the television series Loki illustrates how design and function morph as we look back at the past, at a decade which is now hazy to remember.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/712/medium800/lcds___displays_loki.png?1677081404 "19A0" retro technology in the series Loki (via Boing Boing))

[Dana Sibera](https://twitter.com/NanoRaptor) posts on social media wonderful retro inspired designs. These throwbacks to a bygone era elicit nostalgia yet cannot be pinpointed to any particular time or place.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/711/medium800/lcds___displays_sibera.png?1677081271 Designs by Dana Sibera (via Twitter))

This project draws inspiration from one of Sibera's designs at the bottom of the picture above: Floppy disks with a display built-in to see what files are on the disk. It's a fun thought that this was possible.

There was some technology which had icons, but they were mainly focused on PDA (personal digital assistant) function selection.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/714/medium800/lcds___displays_retro.png?1677082091)

Due to this implementation, the case is slightly larger than a 3.5" floppy in length and width and sixteen millimeters thick to accommodate the [Adafruit PyPortal display module](https://www.adafruit.com/product/4116). One wouldn't want this stuffed into a vintage 3.5" drive, would we (?)

![](https://cdn-learn.adafruit.com/assets/assets/000/118/829/medium800/lcds___displays_pica1.jpg?1677117971)

## Parts
The Adafruit PyPortal features a beefy SAMD51 processor, a lovely color display and 8MB of flash storage with optional microSD card (not used in this build but extendable by the reader). There is also WiFi capability, again not in use at present.

### Adafruit PyPortal - CircuitPython Powered Internet Display

[Adafruit PyPortal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4116)
 **PyPortal** , our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Make custom touch screen interface GUIs, all open-source, and Python-powered using&nbsp;tinyJSON / APIs to get news, stock, weather, cat photos,...

In Stock
[Buy Now](https://www.adafruit.com/product/4116)
[Related Guides to the Product](https://learn.adafruit.com/products/4116/guides)
![Front view of a Adafruit PyPortal - CircuitPython Powered Internet Display with a pyportal logo image on the display. ](https://cdn-shop.adafruit.com/640x480/4116-00.jpeg)

This USB micro B cable is actually reversible like a USB C connector. Adafruit has quite a selection of USB micro B cables, please ensure it has data & power wires and is long enough for your setup. The project (as designed) is powered from USB (no battery), so plan accordingly.

### Fully Reversible Pink/Purple USB A to micro B Cable - 1m long

[Fully Reversible Pink/Purple USB A to micro B Cable - 1m long](https://www.adafruit.com/product/4111)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also fully reversible! That's right, you will save _seconds_ a day by not having to flip the cable around.

First let's talk about the cover and over-molding. We got these...

In Stock
[Buy Now](https://www.adafruit.com/product/4111)
[Related Guides to the Product](https://learn.adafruit.com/products/4111/guides)
![Fully Reversible Pink/Purple USB A to micro B Cable](https://cdn-shop.adafruit.com/640x480/4111-02.jpg)

# A Floppy Thumb Drive with a Color File Icon Display

## 3D Printing the Case and Assembly

You can print the floppy case in any color you like, but printing it in beige gives it a retro look. And a grey or silver works well for the window and hub.

## CAD Parts List

STL files for 3D printing are oriented to print "as-is" on FDM style machines. Parts are designed to 3D print with PLA filament. Original design source may be downloaded using the links below.

- Front Cover.stl
- Back Door.stl
- Front Door.stl
- Disk.stl
- Back Cover.stl

![lcds___displays_3d-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/733/medium640/lcds___displays_3d-parts.jpg?1677092885)

[Download STLs.zip](https://cdn-learn.adafruit.com/assets/assets/000/118/724/original/STLs.zip?1677088909)
[Download CAD source](https://cdn-learn.adafruit.com/assets/assets/000/118/725/original/CAD.zip?1677088934)
Info: 

## Build Volume

The parts require a 3D printer with a minimum build volume.

- 95mm (X) x 102mm (Y) x 14mm (Z)

![lcds___displays_cura-part-size.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/722/medium640/lcds___displays_cura-part-size.jpg?1677088700)

## CURA Slicer Settings

The **Front Cover** part requires support material in order to properly 3D print. Use the following settings for best results.

- Support Density: 15%
- Support Z Distance: 0.21mm
- Enable Support Interface: Yes
- Support Interface Thickness: 0.4mm
- Support Interface Density: 75%

![lcds___displays_cura-support-settings.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/726/medium640/lcds___displays_cura-support-settings.jpg?1677088963)

## Support Blockers in CURA

Use support blockers to reduce the amount of material needed. Apply support blockers to the arrow and two mounting holes of the Front Cover.&nbsp;

![lcds___displays_cura-support-blockers.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/727/medium640/lcds___displays_cura-support-blockers.jpg?1677089151)

## Layer Line Direction

Rotate the Front Cover at 45 degrees to create parallel lines in the supported areas. This will help to create better quality surfaces. Use the Preview tab in CURA slicer to see how the layers will be laid down. Goto layer #9 to see the direction of the lines in the supported areas.

![lcds___displays_cura-rotated-45.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/729/medium640/lcds___displays_cura-rotated-45.jpg?1677089583)

## CAD Assembly

The PyPortal is secured to the Front Cover using two sets of machine screws. The bottom standoffs require 2x M2.5 x 10mm screws and nuts. The top standoffs require 2x M3 x 6mm screws. The Front and Back Cover snap fit together.

![lcds___displays_CAD-assembly.gif](https://cdn-learn.adafruit.com/assets/assets/000/118/723/medium640thumb/lcds___displays_CAD-assembly.jpg?1677088732)

The Door assembly snap fits onto the top section of the Front and Back covers. The Front and Back Door parts are glued together using adhesives. The disk hub may snap fit into the center hole of the Back Cover or it might need a bit of adhesive also, depending on the print.&nbsp;

## Hardware for PyPortal

Use the following hardware for securing the PyPortal to the case.

- 2x M2.5 x 10mm long screws
- 2x M2.5 hex nuts
- 2x M3 x 6mm long screws

![lcds___displays_pyportal-hardware.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/731/medium640/lcds___displays_pyportal-hardware.jpg?1677092808)

## Install Disk to Back Cover

Position the disk part over the center hole of the back cover. Firmly press the disk into the hole to snap fit into place.

![lcds___displays_disk-back-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/734/medium640/lcds___displays_disk-back-installed.jpg?1677093173)

![lcds___displays_disk-back-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/735/medium640/lcds___displays_disk-back-install.jpg?1677093058)

## Screws for PyPortal

Orient the PyPortal with the Front Cover in preparation for installation.&nbsp;

The M3 screws will be used on the upper set of standoffs while the M2.5 screws will be used on the lower set.

![lcds___displays_front-pyportal-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/736/medium640/lcds___displays_front-pyportal-screws.jpg?1677093285)

## Secure PyPortal to Front Cover

Place the PyPortal over the Front Cover with the mounting holes lined up with the standoffs.

Insert and fasten the M3 screws to the upper set of standoffs until the screw head are flush with the mounting tabs.

![lcds___displays_pyportal-front-securing.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/737/medium640/lcds___displays_pyportal-front-securing.jpg?1677093361)

![lcds___displays_pyportal-front-secure.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/738/medium640/lcds___displays_pyportal-front-secure.jpg?1677093387)

## Install M2.5 Hardware

Insert an M2.5 x 10mm long screw through the holes on the Front Cover. The screws should pass-through.

Flip the Front Cover and begin installing an M2.5 hex nut onto the thread of the M2.5 screw.

![lcds___displays_pyportal-install-longscrews.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/739/medium640/lcds___displays_pyportal-install-longscrews.jpg?1677093496)

![lcds___displays_pyportal-install-hexnuts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/740/medium640/lcds___displays_pyportal-install-hexnuts.jpg?1677093523)

## Secure M2.5 Hardware

Use a screwdriver to fasten the M2.5 screw to the hex nut.&nbsp;

![lcds___displays_pyportal-secure-longscrews.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/741/medium640/lcds___displays_pyportal-secure-longscrews.jpg?1677184234)

## Secured PyPortal

Repeat the process for the second set of M2.5 hardware.

![lcds___displays_pyportal-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/742/medium640/lcds___displays_pyportal-secured.jpg?1677119692)

## Installing Front to Back

Orient the front and back covers in preparation for installing together.

Join the front and back covers by snap fitting them together.

![lcds___displays_front-back-covers.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/743/medium640/lcds___displays_front-back-covers.jpg?1677119677)

![lcds___displays_front-back-join.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/745/medium640/lcds___displays_front-back-join.jpg?1677119914)

## Install Front Door

Orient the front door with the case so that the nub is lined up with the slot on the front cover.

Insert the front door at an angle to snap fit into place. Slide the front door to lock it into position.

![lcds___displays_install-front-door.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/749/medium640/lcds___displays_install-front-door.jpg?1677119848)

![lcds___displays_installed-front-door.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/750/medium640/lcds___displays_installed-front-door.jpg?1677184248)

## Install Back Door

The back door can be attached to either the front door or back cover using adhesives such as super glue or double-sided tape.

&nbsp;

![lcds___displays_install-back-door.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/752/medium640/lcds___displays_install-back-door.jpg?1677184295)

![lcds___displays_installed-back-door.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/754/medium640/lcds___displays_installed-back-door.jpg?1677185264)

## Final Build

Connect the PyPortal to a 5V USB power supply to power it on. Congratulations on your build!

![lcds___displays_hero-pyportal.jpg](https://cdn-learn.adafruit.com/assets/assets/000/118/793/medium640/lcds___displays_hero-pyportal.jpg?1677114601)

![](https://cdn-learn.adafruit.com/assets/assets/000/118/797/medium800/lcds___displays_hero-pyportal-holding.jpg?1677114899)

![](https://cdn-learn.adafruit.com/assets/assets/000/118/820/medium800/lcds___displays_pica1.jpg?1677116671)

![](https://cdn-learn.adafruit.com/assets/assets/000/118/821/medium800/lcds___displays_pic2.jpg?1677116642)

# A Floppy Thumb Drive with a Color File Icon Display

## 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** &nbsp;"flash" drive to iterate.

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

## Set up CircuitPython Quick Start!

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

[Download the latest version of CircuitPython for the PyPortal via CircuitPython.org](https://circuitpython.org/board/pyportal/)
[Download the latest version of CircuitPython for the PyPortal Pynt via CircuitPython.org](https://circuitpython.org/board/pyportal_pynt/)
 **Click the link above to download the latest version of CircuitPython for the PyPortal.**

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

![circuitpython_pyportal-uf2.png](https://cdn-learn.adafruit.com/assets/assets/000/073/615/medium640/circuitpython_pyportal-uf2.png?1553610968)

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

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

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

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

![circuitpython_PyPortalResetNeoPIxel.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/993/medium640/circuitpython_PyPortalResetNeoPIxel.jpg?1551213425)

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

Drag the **adafruit-circuitpython-pyportal-\<whatever\>.uf2** file to **PORTALBOOT.**

![circuitpython_PyPortal_PORTALBOOT.png](https://cdn-learn.adafruit.com/assets/assets/000/072/029/medium640/circuitpython_PyPortal_PORTALBOOT.png?1551287972)

![circuitpython_PyPortal_Drag_UF2.png](https://cdn-learn.adafruit.com/assets/assets/000/072/030/medium640/circuitpython_PyPortal_Drag_UF2.png?1551287983)

The LED will flash. Then, the **PORTALBOOT** drive will disappear and a new disk drive called **CIRCUITPY** will appear.

If you haven't added any code to your board, the only file that will be present is **boot\_out.txt**. This is absolutely normal! It's time for you to add your **code.py** and get started!

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

![circuitpython_PyPortalCIRCUITPY.png](https://cdn-learn.adafruit.com/assets/assets/000/071/995/medium640/circuitpython_PyPortalCIRCUITPY.png?1551213875)

## PyPortal Default Files

Click below to download a zip of the files that shipped on the PyPortal or PyPortal Pynt.

[PyPortal Default Files](https://github.com/adafruit/circuitpython-default-files/tree/main/boards/pyportal/4.x)
[PyPortal Pynt Default Files](https://github.com/adafruit/circuitpython-default-files/tree/main/boards/pyportal_pynt/5.x)
# A Floppy Thumb Drive with a Color File Icon Display

## CircuitPython Code

It is suggested you use the latest version of CircuitPython available (8.x at the time of writing this guide) for best results.

## Text Editor

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

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

## Download the Project Bundle

Your project will use a specific set of CircuitPython libraries, and the&nbsp; **code.py** &nbsp;file. 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 PyPortal **CIRCUITPY** &nbsp;drive, replacing any existing files or directories with the same names, and adding any new ones that are necessary.

Files in the bundle:

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

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

Coding the application on the Adafruit PyPortal with CircuitPython provides a clean, high level method of creating a user interface which can be adapted for other displays of varying sizes and types.

If a greyscale display, smaller (or larger) display or possibly an eInk device was desired, the application only would need a few changes (if there is capacitive touch, a bit more coding to use buttons if not).

## Code Overview

The code starts off importing a number of CircuitPython libraries:

```python
import os
import time
import board
import displayio
import adafruit_imageload
import terminalio
import adafruit_touchscreen
from adafruit_display_text import label
from adafruit_display_shapes.rect import Rect
```

A function, `get_files()`, gets a dictionary of files for the passed-in director name. For this demo, the base directory "/" is used. If the code is modified to do subdirectories, etc. the function only needs the correct path. The return is a dictionary of filename, boolean tuples. If the boolean is True, the filename refers to a directory.&nbsp;

```auto
# Get a dictionary of filenames at the passed base directory
#    each entry is a tuple (filename, bool) where bool = true
#    means the filename is a directory, else false.
def get_files(base):
    files = os.listdir(base)
    file_names = []
    for j, filetext in enumerate(files):
        if not filetext.startswith("."):
            if filetext not in ('boot_out.txt', 'System Volume Information'):
                stats = os.stat(base + filetext)
                isdir = stats[0] &amp; 0x4000
                if isdir:
                    file_names.append((filetext, True))
                else:
                    file_names.append((filetext, False))
    return filenames
```

And then a function to wait and get a touchscreen touch and return the x coordinate only (all that is needed):

```auto
def get_touch(screen)
    p = None
    while p is None:
        time.sleep(0.05)
        p = screen.touch_point
    return p[0]
```

The values which get the file icons spaced out appropriately. The values are for PyPortal, but if you want to use a different display, you can change the values here rather than "magic numbers" scattered throughout the code.

```python
# Icon Positions
ICONSIZE = 48
SPACING = 18
LEFTSPACE = 38
TOPSPACE = 10
TEXTSPACE = 10
ICONSACROSS = 4
ICONSDOWN = 3
PAGEMAXFILES = ICONSACROSS * ICONSDOWN  # For the chosen display, this is the
#                                     maximum number of file icons that will fit
#                                     on the display at once (display dependent)
```

There is blank icon, followed by five defined file icons,&nbsp; and the left & right arrows for pagination. If more icons are wanted, add them after the last file icon (currently PY).

```python
# File Types
BLANK = 0
FILE = 1
DIR = 2
BMP = 3
WAV = 4
PY = 5
RIGHT = 6
LEFT = 7
```

The display is then set up. The code uses the CircuitPython displayio framework. The display touchscreen is set up for use.

```auto
# Use the builtin display
display = board.DISPLAY
WIDTH = board.DISPLAY.width
HEIGHT = board.DISPLAY.height
ts = adafruit_touchscreen.Touchscreen(board.TOUCH_XL, board.TOUCH_XR,
                                      board.TOUCH_YD, board.TOUCH_YU,
                                      calibration=((5200, 59000), (5800, 57000)),
                                      size=(WIDTH, HEIGHT))

# Create base display group
displaygroup = displayio.Group()
```

Now to load the icons:

```auto
# Load the bitmap (this is the "spritesheet")
sprite_sheet, palette = adafruit_imageload.load("/icons.bmp")
```

This code sets up all the icon positions based on the constants defined earlier:

```python
sprites = []
labels = []
for _ in range(PAGEMAXFILES):
    sprite = displayio.TileGrid(sprite_sheet, pixel_shader=palette,
                                width=1, height=1, tile_height=48,
                                tile_width=48,)
    sprites.append(sprite)  # Append the sprite to the sprite array
    displaygroup.append(sprite)
    filelabel = label.Label(terminalio.FONT, color=0xFFFFFF)
    labels.append(filelabel)
    displaygroup.append(filelabel)

# Make the more files and less files icons (&gt; &lt;)
moresprite = displayio.TileGrid(sprite_sheet, pixel_shader=palette,
                                width=1, height=1, tile_height=48,
                                tile_width=48,)
displaygroup.append(moresprite)
moresprite.x = WIDTH - ICONSIZE + TEXTSPACE
moresprite.y = int((HEIGHT - ICONSIZE) / 2)
lesssprite = displayio.TileGrid(sprite_sheet, pixel_shader=palette,
                                width=1, height=1, tile_height=48,
                                tile_width=48,)
displaygroup.append(lesssprite)
lesssprite.x = -10
lesssprite.y = int((HEIGHT - ICONSIZE) / 2)

display.root_group = displaygroup
```

The code iterates through all the filenames, displaying them in sequential icon locations. The icons are labeled with the first 10 characters of the filename (without the extension). This can be changed, there isn't a lot of room.

```auto
filename, dirfile = filenames[currentfile]
        if dirfile:
            filetype = DIR
        elif filename.endswith(".bmp"):
            filetype = BMP
        elif filename.endswith(".wav"):
            filetype = WAV
        elif filename.endswith(".py"):
            filetype = PY
        else:
            filetype = FILE
        # Set icon location information and icon type
        sprites[spot].x = xpos
        sprites[spot].y = ypos
        sprites[spot][0] = filetype
        #
        # Set filename
        labels[spot].x = xpos
        labels[spot].y = ypos + ICONSIZE + TEXTSPACE
        # The next line gets the filename without the extension, first 11 chars
        labels[spot].text = filename.rsplit('.', 1)[0][0:10]
```

The next chunk of code is lengthy, handling the pagination. Putting the \< and \> icons on screen as necessary, check for a touch on the screen, and changing pages (clearing any icons as needed). It's page oriented, there is not smooth scrolling or any dragging a finger to see files.

```auto
touch_x = get_touch(ts)
        print("Touch Registered ")
        # Check if touch_x is around the LEFT or RIGHT arrow
        currentpage = PAGE
        if touch_x &gt;= int(WIDTH - ICONSIZE):    # &gt; Touched
            if moresprite[0] != BLANK:          # Ensure there are more
                if spot == (PAGEMAXFILES - 1):  # Page full
                    if currentfile &lt; (len(filenames)):  # and more files
                        PAGE = PAGE + 1         # Increment page
        if touch_x &lt;= ICONSIZE:                 # &lt; Touched
            if PAGE &gt; 1:
                PAGE = PAGE - 1                 # Decrement page
            else:
                lesssprite[0] = BLANK        # Not show &lt; for first page
        print("Page ", PAGE)
    # Icon Positioning

    if PAGE != currentpage:  # We have a page change
        # Reset icon locations to upper left
        xpos = LEFTSPACE
        ypos = TOPSPACE
        spot = 0
        if currentpage &gt; PAGE:
            # Decrement files by a page (current page &amp; previous page)
            currentfile = currentfile - (PAGEMAXFILES * 2) + 1
        else:
            # Forward go to the next file
            currentfile = currentfile + 1
    else:
        currentfile += 1             # Increment file counter
        spot += 1                    # Increment icon space counter
        if spot == PAGEMAXFILES:     # Last page ended with 
            print("hit")
        # calculate next icon location
        if spot % ICONSACROSS:       # not at end of icon row
            xpos += SPACING + ICONSIZE
        else:                        # start new icon row
            ypos += ICONSIZE + SPACING + TEXTSPACE
            xpos = LEFTSPACE
    # End If Changed Page
    # Blank out rest if needed
    if currentfile == len(filenames):
        for i in range(spot, PAGEMAXFILES):
            sprites[i][0] = BLANK
            labels[i].text = " "
# End while
```

# A Floppy Thumb Drive with a Color File Icon Display

## Use

When the code is loaded on the PyPortal, it will have the necessary files to run the application. This will leave almost 8 megabytes of flash memory for your own files. As floppies are not high storage devices, this is not either (this holds about eight times the amount of data a 3.5" floppy did back at the turn of the century).

Whenever the project is plugged into a USB cable (via power source or to a computer), it will display the first twelve files in the root directory.

Directories are displayed (but one cannot drill into subdirectories by touch in this implementation, although it's possible for the user to look to add that capability to the code).

To see more than twelve files, there is a "\>" icon on the middle right of the screen (if there are more than 12 root directory files) to scroll to the next screenful of file icons. When on the second page and any subsequent pages, a "\<" icon will be displayed to move back pages. These movement icons disappear as appropriate. You may want to use a fingernail to click the \< and \> icons.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/715/medium800/lcds___displays_icons.bmp?1677084594)

The file icons are stored in icons.bmp, a Windows bitmap format easily read by microcontrollers. In the current implementation, they are:

- Blank
- Generic File
- Directory/Folder
- Bitmap Graphics File
- WAV file (sound)
- Python (.py) File
- Next Page "\>"
- Previous Page "\<"

Additional types of file icons may be added with appropriate changes to the code to select the correct icon for the file type of the file at hand (described in the Code Overview).

If files are added or deleted, the CircuitPython app restarts - this is normal file system behavior for CircuitPython.

Clicking on an icon is not currently implemented. One could attempt to view images, play sound, and print out text files. An advanced application, but certainly possible.

## Going Further

Making the floppy emulate a thumb drive is a natural extension of the way CircuitPython works.

Some have asked for the device to act like a floppy drive. That could take a lot more work, likely in Arduino. Putting floppy images on the thumb drive would work fine, it would be up to whatever the floppy is connected to to read the floppy image files and use them appropriately. Such work would be a project for the user.

Emulated floppies might be another project in the future, but it is not expected for this particular project.


## Featured Products

### Adafruit PyPortal - CircuitPython Powered Internet Display

[Adafruit PyPortal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4116)
 **PyPortal** , our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Make custom touch screen interface GUIs, all open-source, and Python-powered using&nbsp;tinyJSON / APIs to get news, stock, weather, cat photos,...

In Stock
[Buy Now](https://www.adafruit.com/product/4116)
[Related Guides to the Product](https://learn.adafruit.com/products/4116/guides)
### Fully Reversible Pink/Purple USB A to micro B Cable - 1m long

[Fully Reversible Pink/Purple USB A to micro B Cable - 1m long](https://www.adafruit.com/product/4111)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also fully reversible! That's right, you will save _seconds_ a day by not having to flip the cable around.

First let's talk about the cover and over-molding. We got these...

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

## Related Guides

- [Adafruit PyPortal - IoT for CircuitPython](https://learn.adafruit.com/adafruit-pyportal.md)
- [PyPortal Tides Viewer](https://learn.adafruit.com/pyportal-tides-viewer.md)
- [Program CircuitPython USB Devices with iPhone & iPad](https://learn.adafruit.com/use-circuitpython-devices-with-iphone-ipad.md)
- [PyPortal Discord Online Counter](https://learn.adafruit.com/pyportal-discord-online-count.md)
- [How to Make Animated Graphics for Hologram Displays](https://learn.adafruit.com/how-to-make-animated-graphics-for-hologram-displays.md)
- [CircuitPython Display_Text Library](https://learn.adafruit.com/circuitpython-display-text-library.md)
- [League of Legends Level Trophy for PyPortal](https://learn.adafruit.com/league-of-legends-level-trophy-for-pyportal.md)
- [Melting Picture Frame for PyPortal IoT images](https://learn.adafruit.com/pyportal-art-display.md)
- [PyPortal IoT Plant Monitor with Microsoft Azure IoT and CircuitPython](https://learn.adafruit.com/using-microsoft-azure-iot-with-circuitpython.md)
- [Getting Started with Braille Output for CircuitPython REPL](https://learn.adafruit.com/getting-started-braille-output-circuitpython-repl.md)
- [TFT Spirit Board](https://learn.adafruit.com/tft-spirit-board.md)
- [Creating Slideshows in CircuitPython](https://learn.adafruit.com/creating-slideshows-in-circuitpython.md)
- [PyPortal MQTT Sensor Node/Control Pad for Home Assistant](https://learn.adafruit.com/pyportal-mqtt-sensor-node-control-pad-home-assistant.md)
- [PyPortal Wall Mount](https://learn.adafruit.com/pyportal-wall-mount.md)
- [PyPortal New New New Product Viewer](https://learn.adafruit.com/pyportal-new-new-new-product-viewer.md)
- [Saving CircuitPython Bitmaps and Screenshots](https://learn.adafruit.com/saving-bitmap-screenshots-in-circuitpython.md)
