# Adafruit MEMENTO Camera Board

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/126/809/medium800thumb/adafruit_products_5420-04.jpg?1703190853)

Make memories, or just a cool camera-based project, with **Adafruit's MEMENTO Camera Board**. It's a development board with everything you need to create programmable camera and vision projects: with a camera module, TFT preview screen, buttons, SD card slot and driven by a powerful ESP32-S3 with 2 MB of PSRAM for buffering 5 MegaPixel camera images.

**This product is just the mainboard, and does not come with an enclosure, LED ring, hardware, SD card, or battery.**

![](https://cdn-learn.adafruit.com/assets/assets/000/126/625/medium800/adafruit_products_5420-03.jpg?1702564208)

The ESP32-S3 is a WiFi and Bluetooth LE capable, 240 MHz dual core Tensilica processor - much like the famous ESP32. The S3 adds native USB support so it's great for use with Arduino or CircuitPython. The S3 also has the ability to interface with raw camera modules. The cameras require 12 GPIO pins and fast data transfer in order to get images off the sensor, and then a lot of memory for storing 2560 x 1920 images - which is why we picked an S3 module with 2MB of PSRAM so that we can read JPEGs into memory for saving onto a microSD card with up to 32GB capacity.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/626/medium800/adafruit_products_5420-00.jpg?1702564240)

To make the board easy to use we added a ton of supporting hardware, here's a full list of the hardware included:

- **ESP32-S3 module with 4 MB Flash, 2 MB PSRAM** - dual core 240MHz Tensilica with WiFi and BTLE.
- [**OV5640 camera module with 72 degree view and auto-focus motor**](https://www.adafruit.com/product/5840) - 5MP camera sensor with JPEG encoder built in.
- [**1.54" 240x240 Color TFT**](https://www.adafruit.com/product/4421) - For previewing the camera images, or user interface design.
- **MicroSD card slot** - Store images or animations to any SPI-capable micro SD card. NOTE: You can use cards with up to 32GB capacity.
- **Two Digital/Analog Stemma Ports** - JST PH-3 connectors for A0, A1 and power+ground for adding external buttons, LEDs, or sensors. Can provide 3V or 5V power.
- **I2C Stemma QT Port** - Connect just about any I2C sensor you please with a Stemma QT JST SH port, provides 3.3V power and logic.
- **LIS3DH Accelerometer** - Triple-access accelerometer can detect orientation, shaking or movement.
- **LiPoly battery charging support** - [Use a 3.7/4.2V 350mA](https://www.adafruit.com/product/4237) or [420mA battery](https://www.adafruit.com/product/4236) for on-the-go snaps.
- **6 User Buttons** - change modes, preview saved images, play DOOM (?). Connected through a GPIO expander.
- **Buzzer** - play tones or alerts, or indicate when a photo was successfully taken.
- **Analog Microphone** - Can be used as a sensor to detect loud sounds, not for recording video with audio.
- **Shutter button** - Connected to GPIO 0 for entering the ROM bootloader.
- **Reset button** - For entering the bootloader or starting over.
- **On/Off switch** - Cut all power when using a battery.
- **USB Type C** for programming the ESP32-S3, as well as REPL access in CircuitPython and charging the optional LiPoly battery.
- **Breakout pads for hardware UART** - for more intense debugging needs, solder wires to the through-hole pads to connect to a console cable.
- **Four M3 standoffs** for mounting or enclosure attachment.

We've got both Arduino and CircuitPython example code that lets you preview the camera, adjust settings, and take photos that are saved to disk. However, we recommend CircuitPython because the compilation time in Arduino is pretty intense due to the huge amount of code required to run the camera. [CircuitPython is fast to develop for and our library will make it easy to start making custom camera projects](https://github.com/adafruit/Adafruit_CircuitPython_PyCamera).

# Adafruit MEMENTO Camera Board

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/126/628/medium800/adafruit_products_5420-03.jpg?1702564394)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/629/medium800/adafruit_products_5420-00.jpg?1702564401)

## Microcontroller and WiFi
The main processor chip is the **Espressif ESP32-S3** with 3.3v logic/power. It has 4 **MB** of Flash and **2MB** of **PSRAM**.

The ESP32-S3 comes with WiFi and Bluetooth LE baked right in, though CircuitPython only supports WiFi at this time, not BLE on the S3 chip.

![adafruit_products_esp.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/635/medium640/adafruit_products_esp.jpg?1702667525)

## OV5640 Camera Module
Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/127/724/medium800/adafruit_products_membuild-7163.jpg?1708099303)

In the center of the board is the **OV5640 camera module**. It has a 72 degree view, 5MP sensor and an auto-focus motor.

Below the camera connector is a **jumper** for providing 3.3V to the auto-focus motor. You can cut the jumper to disconnect DATA1 from 3.3V to disable auto-focus.

The camera utilizes the following pins:

- **VSYNC** - GPIO5. Accessible in CircuitPython with `board.CAMERA_VSYNC` and Arduino with `VSYNC_GPIO_NUM`.
- **HREF** - GPIO6. Accessible in CircuitPython with `board.CAMERA_HREF` and Arduino with `HREF_GPIO_NUM`.
- **XCLK** - GPIO8. Accessible in CircuitPython with `board.CAMERA_XCLK` and Arduino with `XCLK_GPIO_NUM`.
- **PCLK** - GPIO11. Accessible in CircuitPython with `board.CAMERA_PCLK` and Arduino with `PCLK_GPIO_NUM`.
- **PWDN** - GPIO21. Accessible in CircuitPython with `board.CAMERA_PWDN` and Arduino with `PWDN_GPIO_NUM`.
- **DATA2** - GPIO13. Accessible in CircuitPython with `board.CAMERA_DATA2` and Arduino with `Y2_GPIO_NUM`.
- **DATA3** - GPIO15. Accessible in CircuitPython with `board.CAMERA_DATA3` and Arduino with `Y3_GPIO_NUM`.
- **DATA4** - GPIO16. Accessible in CircuitPython with `board.CAMERA_DATA4` and Arduino with `Y4_GPIO_NUM`.
- **DATA5** - GPIO14. Accessible in CircuitPython with `board.CAMERA_DATA5` and Arduino with `Y5_GPIO_NUM`.
- **DATA6** - GPIO12. Accessible in CircuitPython with `board.CAMERA_DATA6` and Arduino with `Y6_GPIO_NUM`.
- **DATA7** - GPIO10. Accessible in CircuitPython with `board.CAMERA_DATA7` and Arduino with `Y7_GPIO_NUM`.
- **DATA8** - GPIO9. Accessible in CircuitPython with `board.CAMERA_DATA8` and Arduino with `Y8_GPIO_NUM`.
- **DATA9** - GPIO7. Accessible in CircuitPython with `board.CAMERA_DATA9` and Arduino with `Y9_GPIO_NUM`.
- **RESET** - GPIO47. Accessible in CircuitPython with `board.CAMERA_RESET` and Arduino with `RESET_GPIO_NUM`.

For more information on the OV5640 pins, check out the Adafruit [Learn Guide for the module](https://learn.adafruit.com/adafruit-ov5640-camera-breakout/pinouts).

![adafruit_products_camera.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/639/medium640/adafruit_products_camera.jpg?1702669479)

## TFT Screen
On the front of MEMENTO is the **1.54" 240x240 Color TFT**. It can be used for previewing the camera images or user interface design. It uses the ST7789 driver, which has both Arduino and CircuitPython support. It uses the following pins for SPI communication:

- **MOSI** - GPIO35. Accessible in CircuitPython with `board.MOSI` and Arduino with `MOSI`.
- **SCK** - GPIO36. Accessible in CircuitPython with `board.SCK` and Arduino with `SCK`.
- **MISO** - GPIO37. Accessible in CircuitPython with `board.MISO` and Arduino with `MISO`.
- **DC** - GPIO40. Accessible in CircuitPython with `board.TFT_DC` and Arduino with `TFT_DC`.
- **CS** - GPIO39. Accessible in CircuitPython with `board.TFT_CS` and Arduino with `TFT_CS`.
- **Backlight** - GPIO45. Accessible in CircuitPython with `board.TFT_BACKLIGHT` and Arduino with `TFT_BACKLIGHT`.
- **Reset** - GPIO38. Accessible in CircuitPython with `board.TFT_RESET` and Arduino with `TFT_RESET` or `TFT_RST`.

![adafruit_products_tft.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/686/medium640/adafruit_products_tft.jpg?1702677481)

## Hardware UART
To the right of the ESP32-S3 module and above the TFT connector are the breakout pads for **hardware UART**. These pins, labeled **RX** and **TX** on the board silk, are for more intense debugging needs. You can solder wires to the through-hole pads to connect to a console cable.

![adafruit_products_rxTx.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/667/medium640/adafruit_products_rxTx.jpg?1702675184)

## GPIO Expander
The MEMENTO includes an&nbsp; **AW9523 GPIO Expander**. The IO Expander is connected via the I2C bus. The main purpose of the expander is to add additional pins to communicate with the buttons

The I2C address of the GPIO expander is&nbsp; **0x58**.

![adafruit_products_aw9523.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/636/medium640/adafruit_products_aw9523.jpg?1702668471)

## Accelerometer
On the back of the board, to the left of the GPIO expander, is an **LIS3DH accelerometer**. It is a triple-access accelerometer that can detect orientation, shaking or movement. It communicates over I2C on address **0x19**. Its interrupt ( **IRQ** ) pin is connected to GPIO3, which is accessible in CircuitPython with `board.IRQ` and Arduino with `3`.

![adafruit_products_accel.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/655/medium640/adafruit_products_accel.jpg?1702672814)

## User Buttons
On the front of the board are six user buttons. **They are connected through the AW9523 GPIO expander:**

- OK button - pin 11
- Select button - pin 1
- Up button - pin 13
- Down button - pin 15
- Left button - pin 14
- Right button - pin 12

Both the [Arduino](https://github.com/adafruit/Adafruit_PyCamera) and [CircuitPython](https://github.com/adafruit/Adafruit_CircuitPython_PyCamera) PyCamera libraries have built-in support for these buttons to easily access them.

![adafruit_products_buttons.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/693/medium640/adafruit_products_buttons.jpg?1702678455)

## Reset and Boot Buttons
Along the top edge of the board are two buttons. The **boot button** , labeled **Boot** and **Shutter** on the board silk, is connected to **GPIO0**. It's accessible in CircuitPython with `board.BUTTON` and Arduino with `SHUTTER_BUTTON`. You'll hold it while pressing reset to enter ROM Bootloader mode.

The **reset button** , labeled **RST** on the board silk, is connected to the ESP32-S3 reset pin. Click it once to restart your firmware. Click it again after about a half second to enter bootloader mode.

![adafruit_products_boot__reset.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/658/medium640/adafruit_products_boot__reset.jpg?1702673234)

## Analog MEMS Microphone
On the front of MEMENTO, above the cluster of four user buttons, is the **analog MEMS microphone**. It is labeled **Mic** on the board silk. It can be used as a sensor to detect loud sounds. It is **not** for recording video with audio. The analog input from the microphone is connected to GPIO2. It's accessible in CircuitPython with `board.MIC` and Arduino with `2`.

![adafruit_products_mic.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/678/medium640/adafruit_products_mic.jpg?1702676168)

## Speaker
Below the TFT display is the **speaker**. It is labeled **Speaker** on the board silk. The output from the speaker is connected to GPIO46. It is accessible in CircuitPython with `board.SPEAKER` and Arduino with `SPEAKER`.

**The speaker is muted via pin 0 on the AW9523 GPIO expander, so don't forget to de-mute before expecting it to make noise!**

![adafruit_products_speaker.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/692/medium640/adafruit_products_speaker.jpg?1702678053)

## JST-PH Connectors
On the left side of the board are connectors labeled **A0** and **A1**. These are **3-pin JST connectors** for sensors, NeoPixels, or analog output or input. A0 is connected to GPIO17 (accessible with `board.A0` in CircuitPython and `A0` in Arduino) and A1 is connected to GPIO18 (accessible with `board.A1` in CircuitPython and `A1` in Arduino).

Between both connectors is a jumper labeled **5V3**. It can be cut and soldered to use&nbsp; **3V** &nbsp;instead of&nbsp; **5V** for the VCC signal on the JST connectors.

![adafruit_products_jst-3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/638/medium640/adafruit_products_jst-3.jpg?1702668761)

## I2C/Stemma QT Connector
There is a 4-pin&nbsp; **Stemma QT&nbsp;connector** &nbsp;on the left. The I2C has pullups to 3.3V power.

The I2C pins are connected to GPIO34 (SDA) and GPIO33 (SCL). In Arduino, you can use the STEMMA connector with `Wire`. In CircuitPython, you can use the STEMMA connector with `board.SCL`&nbsp;and&nbsp;`board.SDA`, `board.I2C()` or `board.STEMMA_I2C()`.

![adafruit_products_stemma.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/637/medium640/adafruit_products_stemma.jpg?1702668591)

## microSD Card Slot
Towards the bottom left corner on the back of MEMENTO is the **microSD card slot**. You can store images or animations to any SPI-capable micro SD card.

- **SDCS** ( **c** hip **s** elect pin)&nbsp; - connected to GPIO48. It is accessible in CircuitPython with `board.CARD_CS` and Arduino with `SD_CS` or `SD_CHIP_SELECT`.
- **SDCD** ( **c** ard **d** etect pin) - connected to pin 9 on the AW9523.

![adafruit_products_sdCard.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/660/medium640/adafruit_products_sdCard.jpg?1702674386)

## NeoPixel
At the top of the board, to the right of the boot button, is the **NeoPixel**. This addressable RGB LED works both as a status LED (in CircuitPython and the bootloader), and can be controlled with code. It is connected to GPIO1 and is available in CircuitPython as `board.NEOPIXEL`&nbsp;and in Arduino as `PIN_NEOPIXEL` or `NEOPIXEL_PIN`.

![adafruit_products_neopixel.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/662/medium640/adafruit_products_neopixel.jpg?1702674912)

## Power
![](https://cdn-learn.adafruit.com/assets/assets/000/126/761/medium800/adafruit_products_POWER_jumper.jpg?1703005932)

- **USB-C port** - This is used for both powering and programming the board. You can power it with any USB C cable. When USB is plugged in it will charge the LiPoly battery.
- **LiPoly connector/charger** - You can plug in any 350mAh or larger 3.7/4.2V LiPoly battery into this **JST 2-PH port** to both power your MEMENTO and charge the battery. If the battery is plugged in _and USB is plugged in_, the MEMENTO will power itself from USB _and_ it will charge the battery up. There is an outline on the board silk that is perfectly sized for the 420mAh battery in the shop.
- **Battery Monitor Pin** - You can monitor the battery percentage via an ADC pin accessed with `board.BATTERY_MONITOR` in CircuitPython or `BATT_MONITOR` in Arduino.
- **Power Selection Jumper** - Above the TFT display ribbon cable is the power selection jumper. It selects whether the 2.8V supply is powered from 3.3V or 5V. It can be cut and soldered to use 5V instead of 3.3V.

### Lithium Ion Polymer Battery with Short Cable - 3.7V 420mAh

[Lithium Ion Polymer Battery with Short Cable - 3.7V 420mAh](https://www.adafruit.com/product/4236)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 420mAh for a total of about 1.55 Wh. If you need a larger (or smaller!) battery, <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4236)
[Related Guides to the Product](https://learn.adafruit.com/products/4236/guides)
![Lithium Ion Polymer Battery 3.7v 420mAh with JST 2-PH connector and short cable](https://cdn-shop.adafruit.com/640x480/4236-04.jpg)

## On/Off Switch and Power LED
On the top right edge of the board is the **on/off switch** , labeled **On** on the board silk. This sliding switch can cut all power to the board.

To the right of the switch is the **power LED**. It is a green LED and is lit up when the board has power.

![adafruit_products_onOffLed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/659/medium640/adafruit_products_onOffLed.jpg?1702674224)

# Adafruit MEMENTO Camera Board

## 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: Make sure you use CircuitPython 9.0.0 final or later. CircuitPython 9.0.0-beta.1 and earlier have a bug that can corrupt the fileystem.

```auto
import storage
storage.erase_filesystem()
```

Your board will reboot after running this.

[Download the latest version of CircuitPython for this board via circuitpython.org](https://circuitpython.org/board/adafruit_esp32s3_camera/)
Warning: As of CircuitPython 9, you'll need to create a folder called "sd" on your CIRCUITPY drive to mount the microSD card, if it's not already there.

[Follow these steps to create the /sd directory](https://learn.adafruit.com/adafruit-memento-camera-board/circuitpython-memento-starter-projects)
 **Click the link above to download the latest CircuitPython UF2 file.**

Save it wherever is convenient for you.

![install_circuitpython_on_most_boards_CircuitPython_downloaded.jpg](https://cdn-learn.adafruit.com/assets/assets/000/102/129/medium640/install_circuitpython_on_most_boards_CircuitPython_downloaded.jpg?1620922559)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/734/medium800/adafruit_products_resetNeo.jpg?1702908010)

Plug your board into your computer, using a known-good data-sync cable, directly, or via an adapter if needed.

Double-click the **reset** button (highlighted in red above), and you will see the **RGB status LED(s)** turn green (highlighted in green above). If you see red, try another port, or if you're using an adapter or hub, try without the hub, or different adapter or hub.

For this board, tap reset and wait for the LED to turn purple, and as soon as it turns purple, tap reset again. The second tap needs to happen while the LED is still purple.

If you do not see the LED turning purple, you will need to reinstall the UF2 bootloader. See the **Factory Reset** page in this guide for details.

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

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 **CAMERABOOT**. Drag the **adafruit-circuitpython-adafruit\_esp32s3\_camera-etc.uf2** file to **CAMERABOOT**.

![adafruit_products_cameraboot.png](https://cdn-learn.adafruit.com/assets/assets/000/126/740/medium640/adafruit_products_cameraboot.png?1702932896)

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

That's it!

![install_circuitpython_on_most_boards_CIRCUITPY.jpg](https://cdn-learn.adafruit.com/assets/assets/000/102/130/medium640/install_circuitpython_on_most_boards_CIRCUITPY.jpg?1620923145)

# Adafruit MEMENTO Camera Board

## Installing the Mu Editor

Mu is a simple code editor that works with the Adafruit CircuitPython boards. It's written in Python and works on Windows, MacOS, Linux and Raspberry Pi. The serial console is built right in so you get immediate feedback from your board's serial output!

Info: Mu is our recommended editor - please use it (unless you are an experienced coder with a favorite editor already!). While it has been announced end of life in 2026, it still works fine.

You are free to use whatever text editor you wish along with a terminal program to connect to the CircuitPython REPL. Thonny is one such editor.

## Download and Install Mu
Download Mu from&nbsp;[https://codewith.mu](https://codewith.mu/).

Click the&nbsp; **Download** link for downloads and installation instructions.

Click **Start Here&nbsp;** to find a wealth of other information, including extensive tutorials and and how-to's.

&nbsp;

![circuitpython_WtCP_codewithdotmu_main_page.png](https://cdn-learn.adafruit.com/assets/assets/000/105/677/medium640/circuitpython_WtCP_codewithdotmu_main_page.png?1634749167)

Warning: 

## Starting Up Mu
The first time you start Mu, you will be prompted to select your 'mode' - you can always change your mind later. For now please select **CircuitPython**!

The current mode is displayed in the lower right corner of the window, next to the "gear" icon. If the mode says "Microbit" or something else, click the **Mode** button in the upper left, and then choose "CircuitPython" in the dialog box that appears.

![circuitpython_WtCP_Mu_mode_dialogue.png](https://cdn-learn.adafruit.com/assets/assets/000/105/681/medium640/circuitpython_WtCP_Mu_mode_dialogue.png?1634750676)

Mu attempts to auto-detect your board on startup, so if you do not have a CircuitPython board plugged in with a **CIRCUITPY** drive available, Mu will inform you where it will store any code you save until you plug in a board.

To avoid this warning, plug in a board and ensure that the **CIRCUITPY** drive is mounted before starting Mu.

![circuitpython_WtCP_Mu_device_not_found.png](https://cdn-learn.adafruit.com/assets/assets/000/105/679/medium640/circuitpython_WtCP_Mu_device_not_found.png?1634749722)

## Using Mu

You can now explore Mu! The three main sections of the window are labeled below; the button bar, the text editor, and the serial console / REPL.

![](https://cdn-learn.adafruit.com/assets/assets/000/098/505/medium800/circuitpython_Mu_Window_Explained.png?1609970219)

Now you're ready to code! Let's keep going...

# Adafruit MEMENTO Camera Board

## The CIRCUITPY Drive

When CircuitPython finishes installing, or you plug a CircuitPython board into your computer with CircuitPython already installed, the board shows up on your computer as a USB drive called **CIRCUITPY**.

The **CIRCUITPY** drive is where your code and the necessary libraries and files will live. You can edit your code directly on this drive and when you save, it will run automatically. When you create and edit code, you'll save your code in a **code.py** file located on the **CIRCUITPY** drive.&nbsp;If you're following along with a Learn guide, you can paste the contents of the tutorial example into **code.py** on the **CIRCUITPY** drive and save it to run the example.

With a fresh CircuitPython install, on your **CIRCUITPY** drive, you'll find a **code.py** file containing `print("Hello World!")` and an empty **lib** folder. If your **CIRCUITPY** drive does not contain a **code.py** file, you can easily create one and save it to the drive. CircuitPython looks for **code.py** and executes the code within the file automatically when the board starts up or resets. Following a change to the contents of **CIRCUITPY** , such as making a change to the **code.py** file, the board will reset, and the code will be run. You do not need to manually run the code. This is what makes it so easy to get started with your project and update your code!

Note that all changes to the contents of **CIRCUITPY** , such as saving a new file, renaming a current file, or deleting an existing file will trigger a reset of the board.

![](https://cdn-learn.adafruit.com/assets/assets/000/069/228/medium800/circuitpython_CIRCUITPY_Drive.png?1547240788)

## Boards Without CIRCUITPY

CircuitPython is available for some microcontrollers that do not support native USB. Those boards cannot present a **CIRCUITPY** drive. This includes boards using ESP32 or ESP32-C3 microcontrollers.

On these boards, there are alternative ways to transfer and edit files. You can use the [Thonny editor](https://thonny.org), which uses hidden commands sent to the REPL to read and write files. Or you can use the CircuitPython web workflow, introduced in Circuitpython 8. The web workflow provides browser-based WiFi access to the CircuitPython filesystem. These guides will help you with the web workflow:

- [CircuitPython on ESP32 Quick Start](https://learn.adafruit.com/circuitpython-with-esp32-quick-start)
- [CircuitPython Web Workflow Code Editor Quick Start](https://learn.adafruit.com/getting-started-with-web-workflow-using-the-code-editor)

# Adafruit MEMENTO Camera Board

## Creating and Editing Code

One of the best things about CircuitPython is how simple it is to get code up and running. This section covers how to create and edit your first CircuitPython program.

To create and edit code, all you'll need is an editor. There are many options. **Adafruit strongly recommends using Mu! It's designed for CircuitPython, and it's really simple and easy to use, with a built in serial console!**

If you don't or can't use Mu, there are a number of other editors that work quite well. The [Recommended Editors page](https://learn.adafruit.com/welcome-to-circuitpython/recommended-editors) has more details. Otherwise, make sure you do "Eject" or "Safe Remove" on Windows or "sync" on Linux after writing a file if you aren't using Mu. (This was formerly not a problem on macOS, but see the warning below.)

Warning: macOS Sonoma 14.1 introduced a bug that delays writes to small drives such as CIRCUITPY drives. This caused errors when saving files to CIRCUITPY. There is a [workaround](https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#macos-sonoma-14-dot-x-disk-errors-writing-to-circuitpy-3160304). The bug was fixed in Sonoma 14.4, but at the cost of greatly slowed writes to drives 1GB or smaller. 

## Creating Code
Installing CircuitPython generates a **code.py** file on your **CIRCUITPY** drive. To begin your own program, open your editor, and load the **code.py** file from the **CIRCUITPY** drive.

If you are using Mu, click the **Load** button in the button bar, navigate to the **CIRCUITPY** drive, and choose **code.py**.

![circuitpython_WtCP_Mu_open_code_py.png](https://cdn-learn.adafruit.com/assets/assets/000/105/703/medium640/circuitpython_WtCP_Mu_open_code_py.png?1634763740)

Copy and paste the following code into your editor:

```python
import board
import digitalio
import time

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    time.sleep(0.5)
    led.value = False
    time.sleep(0.5)
```

Danger: The KB2040, QT Py , Qualia, and the Trinkeys do not have a built-in little red LED! There is an addressable RGB NeoPixel LED. The above example will NOT work on the KB2040, QT Py, Qualia, or the Trinkeys!

If you're using a KB2040, QT Py, Quaila, or a Trinkey, or any other board without a single-color LED that can blink, please download the [NeoPixel blink example](https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/Welcome_to_CircuitPython/code.py).

Info: 

It will look like this. Note that under the `while True:` line, the next four lines begin with four spaces to indent them, and they're indented exactly the same amount. All the lines before that have no spaces before the text.

![circuitpython_WtCP_Mu_blink_example.png](https://cdn-learn.adafruit.com/assets/assets/000/105/704/medium640/circuitpython_WtCP_Mu_blink_example.png?1634763853)

Save the **code.py** file on your **CIRCUITPY** drive.

![circuitpython_WtCP_Mu_save_bliink_example.png](https://cdn-learn.adafruit.com/assets/assets/000/105/705/medium640/circuitpython_WtCP_Mu_save_bliink_example.png?1634763954)

The little LED should now be blinking. Once per half-second.

Congratulations, you've just run your first CircuitPython program!

Info: On most boards you'll find a tiny red LED. On the ItsyBitsy nRF52840, you'll find a tiny blue LED. On QT Py M0, QT Py RP2040, Qualia, and the Trinkey series, you will find only an RGB NeoPixel LED.

## Editing Code
To edit code, open the&nbsp; **code.py** &nbsp;file on your **CIRCUITPY** drive into your editor.

&nbsp;

Make the desired changes to your code. Save the file. That's it!

![circuitpython_WtCP_Mu_open_code_py.png](https://cdn-learn.adafruit.com/assets/assets/000/105/706/medium640/circuitpython_WtCP_Mu_open_code_py.png?1634764153)

### Your code changes are run as soon as the file is done saving.

There's one warning before you continue...

Danger: 

The CircuitPython code on your board detects when the files are changed or written and will automatically re-start your code. This makes coding very fast because you save, and it re-runs. If you unplug or reset the board before your computer finishes writing the file to your board, you can corrupt the drive. If this happens, you may lose the code you've written, so it's important to backup your code to your computer regularly.

There are a couple of ways to avoid filesystem corruption.

### **1. Use an editor that writes out the file completely when you save it.**

Check out the [Recommended Editors page](https://learn.adafruit.com/welcome-to-circuitpython/recommended-editors) for details on different editing options.

Info: 

### **2. Eject or Sync the Drive After Writing**

If you are using one of our not-recommended-editors, not all is lost! You can still make it work.

On Windows, you can Eject or Safe Remove the **CIRCUITPY** drive. It won't actually eject, but it will force the operating system to save your file to disk. On Linux, use the **sync** command in a terminal to force the write to disk.

You also need to do this if you use Windows Explorer or a Linux graphical file manager to drag a file onto **CIRCUITPY**.

### 

Don't worry! Corrupting the drive isn't the end of the world (or your board!). If this happens, follow the steps found on the [Troubleshooting](https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting) page of every board guide to get your board up and running again.

Info: If you are having trouble saving code on Windows 10, try including this code snippet at the top of <b>code.py</b>:

```python
import supervisor
supervisor.runtime.autoreload = False
```

## Back to Editing Code...

Now! Let's try editing the program you added to your board. Open your **code.py** file into your editor. You'll make a simple change. Change the first `0.5` to `0.1`. The code should look like this:

```python
import board
import digitalio
import time

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    time.sleep(0.1)
    led.value = False
    time.sleep(0.5)
```

Leave the rest of the code as-is. Save your file. See what happens to the LED on your board? Something changed! Do you know why?

You don't have to stop there! Let's keep going. Change the second `0.5` to `0.1` so it looks like this:

```
while True:
    led.value = True
    time.sleep(0.1)
    led.value = False
    time.sleep(0.1)
```

Now it blinks really fast! You decreased the both time that the code leaves the LED on and off!

Now try increasing both of the `0.1` to `1`. Your LED will blink much more slowly because you've increased the amount of time that the LED is turned on and off.

Well done! You're doing great! You're ready to start into new examples and edit them to see what happens! These were simple changes, but major changes are done using the same process. Make your desired change, save it, and get the results. That's really all there is to it!

# Naming Your Program File
CircuitPython looks for a code file on the board to run. There are four options: **code.txt** , **code.py** , **main.txt** and **main.py**. CircuitPython looks for those files, in that order, and then runs the first one it finds. While **code.py** is the recommended name for your code file, it is important to know that the other options exist. If your program doesn't seem to be updating as you work, make sure you haven't created another code file that's being read instead of the one you're working on.

# Adafruit MEMENTO Camera Board

## Exploring Your First CircuitPython Program

First, you'll take a look at the code you're editing.

Here is the original code again for the LED blink example (if your board doesn't have a single-color LED to blink, look instead at the NeoPixel blink example):

```python
import board
import digitalio
import time

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    time.sleep(0.5)
    led.value = False
    time.sleep(0.5)
```

## Imports & Libraries

Each CircuitPython program you run needs to have a lot of information to work. The reason CircuitPython is so simple to use is that most of that information is stored in other files and works in the background. The files built into CircuitPython are called **modules** , and the files you load separately are called **libraries**. Modules are built into CircuitPython. Libraries are stored on your **CIRCUITPY** drive in a folder called **lib**.

```python
import board
import digitalio
import time
```

The `import` statements tells the board that you're going to use a particular library or module in your code. In this example, you imported three modules: `board`, `digitalio`, and `time`. All three of these modules are built into CircuitPython, so no separate library files are needed. That's one of the things that makes this an excellent first example. You don't need anything extra to make it work!&nbsp;

These three modules each have a purpose. The first one,`board`, gives you access to the _hardware on your board_. The second, `digitalio`, lets you _access that hardware as inputs/outputs_._&nbsp;_The third, `time`, let's you control the flow of your code in multiple ways, including passing time by 'sleeping'.

## Setting Up The LED

The next two lines setup the code to use the LED.

```auto
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
```

Your board knows the red LED as `LED`. So, you initialise that pin, and you set it to output. You set `led` to equal the rest of that information so you don't have to type it all out again later in our code.

## Loop-de-loops

The third section starts with a&nbsp; `while` statement. `while True:` essentially means, "forever do the following:". `while True:` creates a loop. Code will loop "while" the condition is "true" (vs. false), and as `True` is never False, the code will loop forever. All code that is indented under `while True:` is "inside" the loop.

Inside our loop, you have four items:

```python
while True:
    led.value = True
    time.sleep(0.5)
    led.value = False
    time.sleep(0.5)
```

First, you have `led.value = True`. This line tells the LED to turn on. On the next line, you have `time.sleep(0.5)`. This line is telling CircuitPython to pause running code for 0.5 seconds. Since this is between turning the led on and off, the led will be on for 0.5 seconds.

The next two lines are similar. `led.value = False` tells the LED to turn off, and `time.sleep(0.5)` tells CircuitPython to pause for another 0.5 seconds. This occurs between turning the led off and back on so the LED will be off for 0.5 seconds too.

Then the loop will begin again, and continue to do so as long as the code is running!

So, when you changed the first `0.5` to `0.1`, you decreased the amount of time that the code leaves the LED on. So it blinks on really quickly before turning off!

Great job! You've edited code in a CircuitPython program!

## What Happens When My Code Finishes Running?

When your code finishes running, CircuitPython resets your microcontroller board to prepare it for the next run of code. That means any set up you did earlier no longer applies, and the pin states are reset.

For example, try reducing the code snippet above by eliminating the loop entirely, and replacing it with `led.value = True`. The LED will flash almost too quickly to see, and turn off. This is because the code finishes running and resets the pin state, and the LED is no longer receiving a signal.

To that end, most CircuitPython programs involve some kind of loop, infinite or otherwise.

## What if I Don't Have the Loop?

If you don't have the loop, the code will run to the end and exit. This can lead to some unexpected behavior in simple programs like this since the "exit" also resets the state of the hardware. This is a different behavior than running commands via REPL. So if you are writing a simple program that doesn't seem to work, you may need to add a loop to the end so the program doesn't exit.

The simplest loop would be:

```python
while True:
    pass
```

And remember - you can press CTRL+C to exit the loop.

See also the [Behavior section in the docs](https://circuitpython.readthedocs.io/en/latest/README.html#behavior).

# Adafruit MEMENTO Camera Board

## Connecting to the Serial Console

One of the staples of CircuitPython (and programming in general!) is something called a "print statement". This is a line you include in your code that causes your code to output text. A print statement in CircuitPython (and Python) looks like this:

`print("Hello, world!")`

This line in your code.py would result in:

`Hello, world!`

However, these print statements need somewhere to display. That's where the serial console comes in!

The serial console receives output from your CircuitPython board sent over USB and displays it so you can see it. This is necessary when you've included a print statement in your code and you'd like to see what you printed. It is also helpful for troubleshooting errors, because your board will send errors and the serial console will display those too.  
  
The serial console requires an editor that has a built in terminal, or a separate terminal program. A terminal is a program that gives you a text-based interface to perform various tasks.

# Are you using Mu?

If so, good news! The serial console&nbsp; **is built into Mu** and will&nbsp; **autodetect your board** making using the serial console _really really easy_.

First, make sure your CircuitPython board is plugged in.

If you open Mu without a board plugged in, you may encounter the error seen here, letting you know no CircuitPython board was found and indicating where your code will be stored until you plug in a board.

[If you are using Windows 7, make sure you installed the drivers](https://learn.adafruit.com/welcome-to-circuitpython/windows-7-and-8-1-drivers).

![circuitpython_WtCP_Mu_no_board_connected_error.png](https://cdn-learn.adafruit.com/assets/assets/000/105/925/medium640/circuitpython_WtCP_Mu_no_board_connected_error.png?1635198700)

Once you've opened Mu with your board plugged in, look for the **Serial** button in the button bar and click it.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/924/medium800/circuitpython_WtCP_Mu_serial_button.png?1635198511)

The Mu window will split in two, horizontally, and display the serial console at the bottom.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/922/medium800/circuitpython_WtcP_Mu_serial.png?1635196320)

Info: 

## Serial Console Issues or Delays on Linux

If you're on Linux, and are seeing multi-second delays connecting to the serial console, or are seeing "AT" and other gibberish when you connect, then the `modemmanager` service might be interfering. Just remove it; it doesn't have much use unless you're still using dial-up modems.

To remove `modemmanager`, type the following command at a shell:

```terminal
sudo apt purge modemmanager
```

## Setting Permissions on Linux

On Linux, if you see an error box something like the one below when you press the **Serial** button, you need to add yourself to a user group to have permission to connect to the serial console.

![](https://cdn-learn.adafruit.com/assets/assets/000/075/267/medium800/circuitpython_no-dialout.png?1557112353)

On Ubuntu and Debian, add yourself to the **dialout** group by doing:

```terminal
sudo adduser $USER dialout
```

After running the command above, reboot your machine to gain access to the group. On other Linux distributions, the group you need may be different. See the [Advanced Serial Console on Linux](https://learn.adafruit.com/welcome-to-circuitpython/advanced-serial-console-on-linux)&nbsp;for details on how to add yourself to the right group.

# Using Something Else?

If you're not using Mu to edit, or if for some reason you are not a fan of its built in serial console, you can run the serial console from a separate program.

Windows requires you to download a terminal program. [Check out the Advanced Serial Console on Windows page for more details.](../../../../welcome-to-circuitpython/advanced-serial-console-on-windows)

MacOS has serial connection programs you can run in Terminal. [Check the Advanced Serial Console on Mac page for more details.](../../../../welcome-to-circuitpython/advanced-serial-console-on-mac-and-linux)

Linux has multiple terminal programs included options are available for download. [Check the Advanced Serial Console on Linux page for more details.](https://learn.adafruit.com/welcome-to-circuitpython/advanced-serial-console-on-linux)

Once connected, you'll see something like the following.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/923/medium800/circuitpython_WtCP_terminal_serial.png?1635196439)

# Adafruit MEMENTO Camera Board

## Interacting with the Serial Console

Once you've successfully connected to the serial console, it's time to start using it.

The code you wrote earlier has no output to the serial console. So, you're going to edit it to create some output.

Open your code.py file into your editor, and include a `print` statement. You can print anything you like! Just include your phrase between the quotation marks inside the parentheses. For example:

```python
import board
import digitalio
import time

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
    print("Hello, CircuitPython!")
    led.value = True
    time.sleep(1)
    led.value = False
    time.sleep(1)
```

Save your file.

Now, let's go take a look at the window with our connection to the serial console.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/225/medium800/circuitpython_CPHelloCPconsole.png?1513104648)

Excellent! Our print statement is showing up in our console! Try changing the printed text to something else.

```python
import board
import digitalio
import time

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
    print("Hello back to you!")
    led.value = True
    time.sleep(1)
    led.value = False
    time.sleep(1)
```

Keep your serial console window where you can see it. Save your file. You'll see what the serial console displays when the board reboots. Then you'll see your new change!

![](https://cdn-learn.adafruit.com/assets/assets/000/049/229/medium800/circuitpython_CPHelloBackConsole.png?1513107530)

The `Traceback (most recent call last):` is telling you the last thing your board was doing before you saved your file. This is normal behavior and will happen every time the board resets. This is really handy for troubleshooting. Let's introduce an error so you can see how it is used.

Delete the `e` at the end of `True` from the line `led.value = True` so that it says `led.value = Tru`

```python
import board
import digitalio
import time

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
    print("Hello back to you!")
    led.value = Tru
    time.sleep(1)
    led.value = False
    time.sleep(1)
```

Save your file. You will notice that your red LED will stop blinking, and you may have a colored status LED blinking at you. This is because the code is no longer correct and can no longer run properly. You need to fix it!

Usually when you run into errors, it's not because you introduced them on purpose. You may have 200 lines of code, and have no idea where your error could be hiding. This is where the serial console can help. Let's take a look!

![](https://cdn-learn.adafruit.com/assets/assets/000/049/241/medium800/circuitpython_CPConsoleCodeError.png?1513109775)

The `Traceback (most recent call last):` is telling you that the last thing it was able to run was `line 10` in your code. The next line is your error: `NameError: name 'Tru' is not defined`. This error might not mean a lot to you, but combined with knowing the issue is on line 10, it gives you a great place to start!

Go back to your code, and take a look at line 10. Obviously, you know what the problem is already. But if you didn't, you'd want to look at line 10 and see if you could figure it out. If you're still unsure, try googling the error to get some help. In this case, you know what to look for. You spelled True wrong. Fix the typo and save your file.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/240/medium800/circuitpython_CPConsoleCodeErrorFixed.png?1513109537)

Nice job fixing the error! Your serial console is streaming and your red LED Is blinking again.

The serial console will display any output generated by your code. Some sensors, such as a humidity sensor or a thermistor, receive data and you can use print statements to display that information. You can also use print statements for troubleshooting, which is called "print debugging". Essentially, if your code isn't working, and you want to know where it's failing, you can put print statements in various places to see where it stops printing.

The serial console has many uses, and is an amazing tool overall for learning and programming!

# Adafruit MEMENTO Camera Board

## The REPL

The other feature of the serial connection is the **R** ead- **E** valuate **-**** P **rint-** L**oop, or REPL. The REPL allows you to enter individual lines of code and have them run immediately. It's really handy if you're running into trouble with a particular program and can't figure out why. It's interactive so it's great for testing new ideas.

## Entering the REPL

To use the REPL, you first need to be connected to the serial console. Once that connection has been established, you'll want to press **CTRL+C**.

If there is code running, in this case code measuring distance, it will stop and you'll see `Press any key to enter the REPL. Use CTRL-D to reload.` Follow those instructions, and press any key on your keyboard.

The `Traceback (most recent call last):` is telling you the last thing your board was doing before you pressed Ctrl + C and interrupted it. The `KeyboardInterrupt` is you pressing CTRL+C. This information can be handy when troubleshooting, but for now, don't worry about it. Just note that it is expected behavior.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/940/medium800/circuitpython_WtCP_ctrl_c_code_running.png?1635269118)

If your **code.py** file is empty or does not contain a loop, it will show an empty output and `Code done running.`. There is no information about what your board was doing before you interrupted it because there is no code running.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/941/medium800/circuitpython_WtCP_ctrl_c_no_code.png?1635269140)

If you have no **code.py** on your **CIRCUITPY** drive, you will enter the REPL immediately after pressing CTRL+C. Again, there is no information about what your board was doing before you interrupted it because there is no code running.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/943/medium800/circuitpython_WtCP_ctrl_c_no_code_py.png?1635269629)

Regardless, once you press a key you'll see a `>>>` prompt welcoming you to the REPL!

![](https://cdn-learn.adafruit.com/assets/assets/000/105/945/medium800/circuitpython_WtCP_entering_REPL.png?1635270441)

If you have trouble getting to the `>>>` prompt, try pressing Ctrl + C a few more times.

The first thing you get from the REPL is information about your board.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/946/medium800/circuitpython_WtCP_REPL_info_header.png?1635270448)

This line tells you the version of CircuitPython you're using and when it was released. Next, it gives you the type of board you're using and the type of microcontroller the board uses. Each part of this may be different for your board depending on the versions you're working with.

This is followed by the CircuitPython prompt.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/947/medium800/circuitpython_WtCP_REPL_prompt.png?1635270536)

## Interacting with the REPL

From this prompt you can run all sorts of commands and code. The first thing you'll do is run `help()`. This will tell you where to start exploring the REPL. To run code in the REPL, type it in next to the REPL prompt.

Type `help()` next to the prompt in the REPL.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/948/medium800/circuitpython_WtcP_REPL_help_prompt.png?1635271482)

Then press enter. You should then see a message.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/949/medium800/circuitpython_WtCP_REPL_help.png?1635271524)

First part of the message is another reference to the version of CircuitPython you're using. Second, a URL for the CircuitPython related project guides. Then... wait. What's this? To list built-in modules type `help("modules").` Remember the modules you learned about while going through creating code? That's exactly what this is talking about! This is a perfect place to start. Let's take a look!

Type `help("modules")` into the REPL next to the prompt, and press enter.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/950/medium800/circuitpython_WtCP_REPL_help_modules.png?1635271533)

This is a list of all the core modules built into CircuitPython, including `board`. Remember, `board` contains all of the pins on the board that you can use in your code. From the REPL, you are able to see that list!

Type `import board` into the REPL and press enter. It'll go to a new prompt. It might look like nothing happened, but that's not the case! If you recall, the `import` statement simply tells the code to expect to do something with that module. In this case, it's telling the REPL that you plan to do something with that module.

![](https://cdn-learn.adafruit.com/assets/assets/000/103/548/medium800/circuitpython_WTCP_the_REPL_import_board.png?1626882305)

Next, type `dir(board)` into the REPL and press enter.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/951/medium800/circuitpython_WtCP_REPL_dir_board.png?1635271604)

This is a list of all of the pins on your board that are available for you to use in your code. Each board's list will differ slightly depending on the number of pins available. Do you see `LED`? That's the pin you used to blink the red LED!

The REPL can also be used to run code. Be aware that **any code you enter into the REPL isn't saved** anywhere. If you're testing something new that you'd like to keep, make sure you have it saved somewhere on your computer as well!

Every programmer in every programming language starts with a piece of code that says, "Hello, World." You're going to say hello to something else. Type into the REPL:

`print("Hello, CircuitPython!")`

Then press enter.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/952/medium800/circuitpython_WtCP_REPL_print.png?1635271677)

That's all there is to running code in the REPL! Nice job!

You can write single lines of code that run stand-alone. You can also write entire programs into the REPL to test them. Remember that nothing typed into the REPL is saved.

There's a lot the REPL can do for you. It's great for testing new ideas if you want to see if a few new lines of code will work. It's fantastic for troubleshooting code by entering it one line at a time and finding out where it fails. It lets you see what modules are available and explore those modules.

Try typing more into the REPL to see what happens!

Warning: 

# Returning to the Serial Console

When you're ready to leave the REPL and return to the serial console, simply press **CTRL+D**. This will reload your board and reenter the serial console. You will restart the program you had running before entering the REPL. In the console window, you'll see any output from the program you had running. And if your program was affecting anything visual on the board, you'll see that start up again as well.

You can return to the REPL at any time!

![](https://cdn-learn.adafruit.com/assets/assets/000/105/942/medium800/circuitpython_WtCP_ctrl_c_no_code_py.png?1635269617)

# Adafruit MEMENTO Camera Board

## CircuitPython Libraries

Danger: 

Each CircuitPython program you run needs to have a lot of information to work. The reason CircuitPython is so simple to use is that most of that information is stored in other files and works in the background. These files are called _libraries_. Some of them are built into CircuitPython. Others are stored on your **CIRCUITPY** drive in a folder called **lib**. Part of what makes CircuitPython so great is its ability to store code separately from the firmware itself. Storing code separately from the firmware makes it easier to update both the code you write and the libraries you depend.

Your board may ship with a **lib** folder already, it's in the base directory of the drive. If not, simply create the folder yourself. When you first install CircuitPython, an empty **lib** directory will be created for you.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/961/medium800/circuitpython_WtCP_CIRCUITPY_contents.png?1635281033)

CircuitPython libraries work in the same way as regular Python modules so the [Python docs](https://docs.python.org/3/tutorial/modules.html) are an excellent reference for how it all should work. In Python terms, you can place our library files in the **lib** directory because it's part of the Python path by default.

One downside of this approach of separate libraries is that they are not built in. To use them, one needs to copy them to the **CIRCUITPY** drive before they can be used. Fortunately, there is a library bundle.

The bundle and the library releases on GitHub also feature optimized versions of the libraries with the **.mpy** file extension. These files take less space on the drive and have a smaller memory footprint as they are loaded.

Due to the regular updates and space constraints, Adafruit does not ship boards with the entire bundle. Therefore, you will need to load the libraries you need when you begin working with your board. You can find example code in the guides for your board that depends on external libraries.

Either way, as you start to explore CircuitPython, you'll want to know how to get libraries on board.

# The Adafruit Learn Guide Project Bundle

The quickest and easiest way to get going with a project from the Adafruit Learn System is by utilising the Project Bundle. Most guides now have a **Download Project Bundle** button available at the top of the full code example embed. This button downloads all the necessary files, including images, etc., to get the guide project up and running. Simply click, open the resulting zip, copy over the right files, and you're good to go!

The first step is to find the Download Project Bundle button in the guide you're working on.

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/111/837/medium800/circuitpython_PB_download_project_bundle_button.png?1652915277)

Warning: 

The Download Project Bundle button downloads a zip file. This zip contains a series of directories, nested within which is the **code.py** , any applicable assets like images or audio, and the **lib/** folder containing all the necessary libraries. The following zip was downloaded from the Piano in the Key of Lime guide.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/838/medium800/circuitpython_PB_downloaded_and_expanded_zip.png?1652915317)

Info: 

When you open the zip, you'll find some nested directories. Navigate through them until you find what you need. You'll eventually find a directory for your CircuitPython version (in this case, 7.x). In the version directory, you'll find the file and directory you need: **code.py** and **lib/**. Once you find the content you need, you can copy it all over to your **CIRCUITPY** drive, replacing any files already on the drive with the files from the freshly downloaded zip.

Info: 

Once you copy over all the relevant files, the project should begin running! If you find that the project is not running as expected, make sure you've copied ALL of the project files onto your microcontroller board.

That's all there is to using the Project Bundle!

# The Adafruit CircuitPython Library Bundle

Adafruit provides CircuitPython libraries for much of the hardware they provide, including sensors, breakouts and more. To eliminate the need for searching for each library individually, the libraries are available together in the Adafruit CircuitPython Library Bundle. The bundle contains all the files needed to use each library.

## Downloading the Adafruit CircuitPython Library Bundle

You can download the latest Adafruit CircuitPython Library Bundle release by clicking the button below. The libraries are being constantly updated and improved, so you'll always want to download the latest bundle.&nbsp;

**Match up the bundle version with the version of CircuitPython you are running.** For example, you would download the 6.x library bundle if you're running any version of CircuitPython 6, or the 7.x library bundle if you're running any version of CircuitPython 7, etc. If you mix libraries with major CircuitPython versions, you will get incompatible mpy errors due to changes in library interfaces possible during major version changes.

[Click to visit circuitpython.org for the latest Adafruit CircuitPython Library Bundle](https://circuitpython.org/libraries)
 **Download the bundle version that matches your CircuitPython firmware version.** If you don't know the version, check the version info in **boot\_out.txt** file on the **CIRCUITPY** drive, or the initial prompt in the CircuitPython REPL. For example, if you're running v7.0.0, download the 7.x library bundle.

There's also a **py** bundle which contains the uncompressed python files, you probably _don't_ want that unless you are doing advanced work on libraries.

# The CircuitPython Community Library Bundle

The CircuitPython Community Library Bundle is made up of libraries written and provided by members of the CircuitPython community. These libraries are often written when community members encountered hardware not supported in the Adafruit Bundle, or to support a personal project. The authors all chose to submit these libraries to the Community Bundle make them available to the community.

**These libraries are maintained by their authors and are not supported by Adafruit.** As you would with any library, if you run into problems, feel free to file an issue on the GitHub repo for the library. Bear in mind, though, that most of these libraries are supported by a single person and you should be patient about receiving a response. Remember, these folks are not paid by Adafruit, and are volunteering their personal time when possible to provide support.

## Downloading the CircuitPython Community Library Bundle

You can download the latest CircuitPython Community Library Bundle release by clicking the button below. The libraries are being constantly updated and improved, so you'll always want to download the latest bundle.

[Click for the latest CircuitPython Community Library Bundle release](https://github.com/adafruit/CircuitPython_Community_Bundle/releases)
The link takes you to the latest release of the CircuitPython Community Library Bundle on GitHub. There are multiple versions of the bundle available. **Download the bundle version that matches your CircuitPython firmware version.** If you don't know the version, check the version info in **boot\_out.txt** file on the **CIRCUITPY** drive, or the initial prompt in the CircuitPython REPL. For example, if you're running v7.0.0, download the 7.x library bundle.

# Understanding the Bundle

After downloading the zip, extract its contents. This is usually done by double clicking on the zip. On Mac OSX, it places the file in the same directory as the zip.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/908/medium800/circuitpython_WtCP_lib_bundle_extracted.png?1635183852)

Open the bundle folder. Inside you'll find two information files, and two folders. One folder is the lib bundle, and the other folder is the examples bundle.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/909/medium800/circuitpython_WtCP_lib_zip_contents.png?1635183864)

Now open the lib folder. When you open the folder, you'll see a large number of **.**** mpy** files, and folders.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/910/medium800/circuitpython_WtCP_lib_bundle_folder_contents.png?1635183871)

## Example Files

All example files from each library are now included in the bundles in an **examples** directory (as seen above), as well as an examples-only bundle. These are included for two main reasons:

- Allow for quick testing of devices.
- Provide an example base of code, that is easily built upon for individualized purposes.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/911/medium800/circuitpython_WtCP_examples_bundle_directory_contents.png?1635184002)

## Copying Libraries to Your Board

First open the **lib** folder on your **CIRCUITPY** drive. Then, open the **lib** folder you extracted from the downloaded zip. Inside you'll find a number of folders and **.mpy** files. Find the library you'd like to use, and copy it to the **lib** folder on **CIRCUITPY**.

If the library is a directory with multiple **.mpy** files in it, be sure to **copy the entire folder to CIRCUITPY/lib**.

This also applies to example files. Open the **examples** folder you extracted from the downloaded zip, and copy the applicable file to your **CIRCUITPY** drive. Then, rename it to **code.py** to run it.

Info: 

# Understanding Which Libraries to Install

You now know how to load libraries on to your CircuitPython-compatible microcontroller board. You may now be wondering, how do you know _which_ libraries you need to install? Unfortunately, it's not always straightforward. Fortunately, there is an obvious place to start, and a relatively simple way to figure out the rest. First up: the best place to start.

When you look at most CircuitPython examples, you'll see they begin with one or more `import` statements. These typically look like the following:

- `import library_or_module`

However, `import` statements can also sometimes look like the following:

- `from library_or_module import name`
- `from library_or_module.subpackage import name`
- `from library_or_module import name as local_name`

They can also have more complicated formats, such as including a `try` / `except` block, etc.

The important thing to know is that **an** `import` **statement will always include the name of the module or library that you're importing**.

Therefore, the best place to start is by reading through the `import` statements.

Here is an example import list for you to work with in this section. There is no setup or other code shown here, as the purpose of this section involves only the import list.

```python
import time
import board
import neopixel
import adafruit_lis3dh
import usb_hid
from adafruit_hid.consumer_control import ConsumerControl
from adafruit_hid.consumer_control_code import ConsumerControlCode
```

Keep in mind, not all imported items are libraries. Some of them are almost always built-in CircuitPython modules. How do you know the difference? Time to visit the REPL.

In the [Interacting with the REPL section](https://learn.adafruit.com/welcome-to-circuitpython/the-repl#interacting-with-the-repl-2977486-14) on [The REPL page](https://learn.adafruit.com/welcome-to-circuitpython/the-repl) in this guide, the `help("modules")` command is discussed. This command provides a list of all of the built-in modules available in CircuitPython for your board. So, if you connect to the serial console on your board, and enter the REPL, you can run `help("modules")` to see what modules are available for your board. Then, as you read through the `import` statements, you can, for the purposes of figuring out which libraries to load, ignore the statement that import modules.

The following is the list of modules built into CircuitPython for the Feather RP2040. Your list may look similar or be anything down to a significant subset of this list for smaller boards.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/967/medium800/circuitpython_WtCP_CP_libs_help_modules_feather_rp2040.png?1635369618)

Now that you know what you're looking for, it's time to read through the import statements. The first two, `time` and `board`, are on the modules list above, so they're built-in.

The next one, `neopixel`, is not on the module list. That means it's your first library! So, you would head over to the bundle zip you downloaded, and search for **neopixel**. There is a **neopixel.mpy** file in the bundle zip. Copy it over to the **lib** folder on your **CIRCUITPY** drive. The following one, `adafruit_lis3dh`, is also not on the module list. Follow the same process for **adafruit\_lis3dh** , where you'll find **adafruit\_lis3dh.mpy** , and copy that over.

The fifth one is `usb_hid`, and it is in the modules list, so it is built in. Often all of the built-in modules come first in the import list, but sometimes they don't! Don't assume that everything after the first library is also a library, and verify each import with the modules list to be sure. Otherwise, you'll search the bundle and come up empty!

The final two imports are not as clear. Remember, when `import` statements are formatted like this, the first thing after the `from` is the library name. In this case, the library name is `adafruit_hid`. A search of the bundle will find an **adafruit\_hid _folder_**. When a library is a folder, you must copy the **entire folder and its contents&nbsp;_as it is in the bundle_** to the **lib** folder on your **CIRCUITPY** drive. In this case, you would copy the entire **adafruit\_hid** folder to your **CIRCUITPY/lib** folder.

Notice that there are _two_ imports that begin with `adafruit_hid`. Sometimes you will need to import more than one thing from the same library. Regardless of how many times you import the same library, you only need to load the library by copying over the **adafruit\_hid** folder _once_.

That is how you can use your example code to figure out what libraries to load on your CircuitPython-compatible board!

There are cases, however, where libraries require other libraries internally. The internally required library is called a _dependency_. In the event of library dependencies, the easiest way to figure out what other libraries are required is to connect to the serial console and follow along with the `ImportError` printed there. The following is a very simple example of an `ImportError`, but the concept is the same for any missing library.

# Example: `ImportError` Due to Missing Library

If you choose to load libraries as you need them, or you're starting fresh with an existing example, you may end up with code that tries to use a library you haven't yet loaded.&nbsp; This section will demonstrate what happens when you try to utilise a library that you don't have loaded on your board, and cover the steps required to resolve the issue.

This demonstration will only return an error if you do not have the required library loaded into the **lib** folder on your **CIRCUITPY** drive **.**

Let's use a modified version of the Blink example.

```auto
import board
import time
import simpleio

led = simpleio.DigitalOut(board.LED)

while True:
    led.value = True
    time.sleep(0.5)
    led.value = False
    time.sleep(0.5)
```

Save this file. Nothing happens to your board. Let's check the serial console to see what's going on.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/964/medium800/circuitpython_WtCP_serial_console_ImportError.png?1635355664)

You have an `ImportError`. It says there is `no module named 'simpleio'`. That's the one you just included in your code!

Click the link above to download the correct bundle. Extract the lib folder from the downloaded bundle file. Scroll down to find **simpleio.mpy**. This is the library file you're looking for! Follow the steps above to load an individual library file.

The LED starts blinking again! Let's check the serial console.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/965/medium800/circuitpython_WtCP_CP_libraries_ImportError_resolved.png?1635355829)

No errors! Excellent. You've successfully resolved an `ImportError`!

If you run into this error in the future, follow along with the steps above and choose the library that matches the one you're missing.

# Library Install on Non-Express Boards

If you have an M0 non-Express board such as Trinket M0, Gemma M0, QT Py M0, or one of the M0 Trinkeys, you'll want to follow the same steps in the example above to install libraries as you need them. Remember, you don't need to wait for an `ImportError` if you know what library you added to your code. Open the library bundle you downloaded, find the library you need, and drag it to the **lib** folder on your **CIRCUITPY** drive.

You can still end up running out of space on your M0 non-Express board even if you only load libraries as you need them. There are a number of steps you can use to try to resolve this issue. You'll find suggestions on the [Troubleshooting page](https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting).

# Updating CircuitPython Libraries and Examples

Libraries and examples are updated from time to time, and it's important to update the files you have on your **CIRCUITPY** drive.

To update a single library or example, follow the same steps above. When you drag the library file to your lib folder, it will ask if you want to replace it. Say yes. That's it!

A new library bundle is released every time there's an update to a library. Updates include things like bug fixes and new features. It's important to check in every so often to see if the libraries you're using have been updated.

## CircUp CLI Tool

There is a command line interface (CLI) utility called [CircUp](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup) that can be used to easily install and update libraries on your device. Follow the directions on the [install page within the CircUp learn guide](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup/install-circup). Once you've got it installed you run the command `circup update` in a terminal to interactively update all libraries on the connected CircuitPython device. See the [usage page in the CircUp guide](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup/usage) for a full list of functionality

# Adafruit MEMENTO Camera Board

## CircuitPython Documentation

You've learned about the CircuitPython built-in modules and external libraries. You know that you can find the modules in CircuitPython, and the libraries in the Library Bundles. There are guides available that explain the basics of many of the modules and libraries. However, there's sometimes more capabilities than are necessarily showcased in the guides, and often more to learn about a module or library. So, where can you find more detailed information? That's when you want to look at the API documentation.

The entire CircuitPython project comes with extensive documentation available on Read the Docs. This includes both the [CircuitPython core](https://circuitpython.readthedocs.io/) and the [Adafruit CircuitPython libraries](https://circuitpython.readthedocs.io/projects/bundle/en/latest/).

## CircuitPython Core Documentation

The [CircuitPython core documentation](https://circuitpython.readthedocs.io/) covers many of the details you might want to know about the CircuitPython core and related topics. It includes API and usage info, a design guide and information about porting CircuitPython to new boards, MicroPython info with relation to CircuitPython, and general information about the project.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/086/medium800/WtCP_circuitpython_docs_index.png?1635887728)

The main page covers the basics including where to **download CircuitPython** , how to **contribute** , **differences from MicroPython** , information about the **project structure** , and a **full table of contents** for the rest of the documentation.

The list along the left side leads to more information about specific topics.

The first section is **API and Usage**. This is where you can find information about how to use individual built-in **core modules** , such as `time` and `digitalio`, details about the **supported ports** , suggestions for **troubleshooting** , and basic info and links to the **library bundles**. The **Core Modules** section also includes the **Support Matrix** , which is a table of which core modules are available on which boards.

The second section is **Design and Porting**  **Reference**. It includes a **design guide** , **architecture** information, details on&nbsp; **porting** , and **adding module support** to other ports.

The third section is **MicroPython Specific**. It includes information on **MicroPython and related libraries** , and a **glossary** of terms.

The fourth and final section is **About the Project**. It includes further information including details on **building, testing, and debugging CircuitPython** , along with various other useful links including the **Adafruit Community Code of Conduct**.

Whether you're a seasoned pro or new to electronics and programming, you'll find a wealth of information to help you along your CircuitPython journey in the documentation!

## CircuitPython Library Documentation

The Adafruit CircuitPython libraries are documented in a very similar fashion. Each library has its own page on Read the Docs. There is a comprehensive list available [here](https://circuitpython.readthedocs.io/projects/bundle/en/latest/). Otherwise, to view the documentation for a specific library, you can visit the GitHub repository for the library, and find the link in the README.

For the purposes of this page, the [LED Animation library](https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation) documentation will be featured. There are two links to the documentation in each library GitHub repo. The first one is the **docs badge** near the top of the README.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/176/medium800/circuitpython_WtCP_docs_badge_README.png?1635966101)

The second place is the **Documentation section** of the README. Scroll down to find it, and click on Read the Docs to get to the documentation.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/177/medium800/circuitpython_WtCP_docs_section_README.png?1635966235)

Now that you know how to find it, it's time to take a look at what to expect.

Info: 

The **Introduction** page is generated from the README, so it includes all the same info, such as PyPI installation instructions, a quick demo, and some build details. It also includes a full table of contents for the rest of the documentation (which is not part of the GitHub README). The page should look something like the following.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/189/medium800/circuitpython_WtCP_lib_docs_introduction.png?1635972070)

The left side contains links to the rest of the documentation, divided into three separate sections: **Examples** , **API Reference** , and **Other Links**.

### Examples

The [Examples section](https://circuitpython.readthedocs.io/projects/led-animation/en/latest/examples.html) is a list of library examples. This list contains anywhere from a small selection to the full list of the examples available for the library.

This section will always contain at least one example - the **simple test** example.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/214/medium800/circuitpython_WtCP_RTD_examples_simpletest.png?1636044287)

The simple test example is usually a basic example designed to show your setup is working. It may require other libraries to run. Keep in mind, it's _simple_ - it won't showcase a comprehensive use of all the library features.

The LED Animation simple test demonstrates the Blink animation.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/217/medium800/circuitpython_WtCP_RTD_examples_simpletest.png?1636044499)

In some cases, you'll find a longer list, that may include examples that explore other features in the library. The LED Animation documentation includes a series of examples, all of which are available in the library. These examples include demonstrations of both basic and more complex features. Simply click on the example that interests you to view the associated code.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/220/medium800/circuitpython_WtCP_RTD_examples_basic_animations.png?1636044898)

Info: 

You can view the rest of the examples by clicking through the list or scrolling down the page. These examples are fully working code. Which is to say, while they may rely on other libraries as well as the library for which you are viewing the documentation, they should not require modification to otherwise work.

### API Reference

The [API Reference section](https://circuitpython.readthedocs.io/projects/led-animation/en/latest/api.html) includes a list of the library functions and classes. The API (Application Programming Interface) of a library is the set of functions and classes the library provides. Essentially, the API defines how your program interfaces with the functions and classes that you call in your code to use the library.

There is always at least one list item included. Libraries for which the code is included in a single Python ( **.py** ) file, will only have one item. Libraries for which the code is multiple Python files in a directory (called subpackages) will have multiple items in this list. The LED Animation library has a series of subpackages, and therefore, multiple items in this list.

Click on the first item in the list to begin viewing the API Reference section.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/221/medium800/circuitpython_WtCP_RTD_API_reference.png?1636045520)

Info: 

When you click on an item in the API Reference section, you'll find details about the classes and functions in the library. In the case of only one item in this section, all the available functionality of the library will be contained within that first and only subsection. However, in the case of a library that has subpackages, each item will contain the features of the particular subpackage indicated by the link. The documentation will cover _all_ of the available functions of the library, including more complex ones that may not interest you.&nbsp;

The first list item is the animation subpackage. If you scroll down, you'll begin to see the available features of animation. They are listed alphabetically. Each of these things can be called in your code. It includes the name and a description of the specific function you would call, and if any parameters are necessary, lists those with a description as well.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/223/medium800/circuitpython_WtCP_RTD_API_initial_info.png?1636047907)

You can view the other subpackages by clicking the link on the left or scrolling down the page. You may be interested in something a little more practical. Here is an example. To use the LED Animation library Comet animation, you would run the following example.

https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation/blob/main/examples/led_animation_comet.py

Note the line where you create the `comet` object. There are a number of items inside the parentheses. In this case, you're provided with a fully working example. But what if you want to change how the comet works? The code alone does not explain what the options mean.

So, in the API Reference documentation list, click the&nbsp; `adafruit_led_animation.animation.comet` link and scroll down a bit until you see the following.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/224/medium800/circuitpython_WtCP_RTD_API_comet.png?1636048923)

Look familiar? It is! This is the documentation for setting up the comet object. It explains what each argument provided in the comet setup in the code meant, as well as the other available features. For example, the code includes `speed=0.02`. The documentation clarifies that this is the "Animation speed in seconds". The code doesn't include `ring`. The documentation indicates this is an available setting that enables "Ring mode".

This type of information is available for any function you would set up in your code. If you need clarification on something, wonder whether there's more options available, or are simply interested in the details involved in the code you're writing, check out the documentation for the CircuitPython libraries!

### Other Links

This section is the same for every library. It includes a list of links to external sites, which you can visit for more information about the CircuitPython Project and Adafruit.

That covers the CircuitPython library documentation! When you are ready to go beyond the basic library features covered in a guide, or you're interested in understanding those features better, the library documentation on Read the Docs has you covered!

# Adafruit MEMENTO Camera Board

## Recommended Editors

The CircuitPython code on your board detects when the files are changed or written and will automatically re-start your code. This makes coding very fast because you save, and it re-runs.

**However, you must**  **wait until the file is done being saved before unplugging or resetting your board!**  **On Windows using some editors this can sometimes take up to**  **90 seconds, on Linux it can take 30 seconds** to complete because the text editor does not save the file completely. Mac OS does not seem to have this delay, which is nice!

This is really important to be aware of. If you unplug or reset the board before your computer finishes writing the file to your board, you can corrupt the drive. If this happens, you may lose the code you've written, so it's important to backup your code to your computer regularly.

To avoid the likelihood of filesystem corruption, use an editor that writes out the file completely when you save it. Check out the list of recommended editors below.

## Recommended editors

- [**mu**](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor) is an editor that safely writes all changes (it's also our recommended editor!)
- [**emacs**](https://www.gnu.org/software/emacs/) is also an editor that will [fulIy write files on save](https://www.gnu.org/software/emacs/manual/html_node/emacs/Customize-Save.html)
- **[Sublime Text](https://www.sublimetext.com/)&nbsp;**safely&nbsp;writes all changes
- **[Visual Studio Code](https://code.visualstudio.com/)** appears to safely write all changes
- **gedit** on Linux appears to safely write all changes
- [IDLE](https://docs.python.org/3/library/idle.html), in Python 3.8.1 or later, [was fixed](https://bugs.python.org/issue36807) to write all changes immediately
- [Thonny](https://thonny.org/) fully writes files on save
- [Notepad++](https://notepad-plus-plus.org/) flushes files after writes, as of several years ago. In addition, you can change the path used for "Enable session snapshot and periodic backup" to write somewhere else than the CIRCUITPY drive. This will save space on CIRCUITPY and reduce writes to the drive.

## Recommended _only_ with particular settings or add-ons

- [**vim**](http://www.vim.org/)&nbsp;/&nbsp; **vi** &nbsp;safely writes all changes. But set up&nbsp; **vim** &nbsp;to not write [swapfiles](https://vi.stackexchange.com/a/179) (.swp files: temporary records of your edits) to **CIRCUITPY**. Run vim with `vim -n`,&nbsp;set the `no swapfile` option, or set the `directory` option to write swapfiles elsewhere. Otherwise the swapfile writes&nbsp;trigger restarts of your program.
- The&nbsp;**[PyCharm IDE](https://www.jetbrains.com/pycharm/)**&nbsp;is safe if "Safe Write" is turned on in Settings-\>System Settings-\>Synchronization (true by default).
- If you are using&nbsp;[**Atom**](https://atom.io/), install the&nbsp;&nbsp;[fsync-on-save package](https://atom.io/packages/fsync-on-save) or the [language-circuitpython package](https://atom.io/packages/language-circuitpython) so that it will always write out all changes to files on **CIRCUITPY**.
- [**SlickEdit**](https://www.slickedit.com/)&nbsp;works only if you&nbsp;[add a macro to flush the disk](https://forums.adafruit.com/viewtopic.php?f=57&t=144412#p713290).

Danger: 

## Editors that are NOT recommended

- **notepad** (the default Windows editor) can be slow to write, so the editors above are recommended! If you are using notepad, be sure to eject the drive.
- **IDLE** in Python 3.8.0 or earlier does not force out changes immediately. Later versions do force out changes.
- **nano** (on Linux) does not force out changes.
- **geany** (on Linux) does not force out changes.
- **Anything else** - Other editors have not been tested so please use a recommended one!

# Adafruit MEMENTO Camera Board

## Advanced Serial Console on Windows

# What's the COM?

First, you'll want to find out which serial port your board is using. When you plug your board in to USB on your computer, it connects to a serial port. The port is like a door through which your board can communicate with your computer using USB.

You'll use Windows Device Manager to determine which port the board is using. The easiest way to determine which port the board is using is to first check **without** the board plugged in. Open Device Manager. Click on Ports (COM & LPT). You should find something already in that list with (COM#) after it where # is a number.

![](https://cdn-learn.adafruit.com/assets/assets/000/048/981/medium800/circuitpython_DeviceManagerWithoutBoard.png?1512750809)

Now plug in your board. The Device Manager list will refresh and a new item will appear under Ports (COM & LPT). You'll find a different (COM#) after this item in the list.

![](https://cdn-learn.adafruit.com/assets/assets/000/048/982/medium800/circuitpython_DeviceManagerWithBoard.png?1512750810)

Sometimes the item will refer to the name of the board. Other times it may be called something like USB Serial Device, as seen in the image above. Either way, there is a new (COM#) following the name. This is the port your board is using.

## Windows Serial Port Terminal Programs

- Putty is a venerable serial port connection program. More details are below.
- [Tera Term](https://teratermproject.github.io/index-en.html) is a nice terminal program. It will reconnect automatically after disconnections
- VSCode has a number of serial port extensions, such as [Serial Monitor](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-serial-monitor).
- PyCharm has a&nbsp; [Serial Port Monitor](https://plugins.jetbrains.com/plugin/8031-serial-port-monitor)&nbsp;plugin.

## Install Putty

PuTTY is a well-known choice for connecting to serial ports on Windows.

The first thing to do is download the [latest version of PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html). You'll want to download the Windows installer file. It is most likely that you'll need the 64-bit version. Download the file and install the program on your machine. If you run into issues, you can try downloading the 32-bit version instead. However, the 64-bit version will work on most PCs.

Now you need to open PuTTY.

- Under **Connection type:** choose the button next to **Serial**.
- In the box under **Serial line** , enter the serial port you found that your board is using.
- In the box under **Speed** , enter 115200. This called the baud rate, which is the speed in bits per second that data is sent over the serial connection. For boards with built in USB it doesn't matter so much but for ESP8266 and other board with a separate chip, the speed required by the board is 115200 bits per second. So you might as well just use 115200!

If you want to save those settings for later, use the options under **Load, save or delete a stored session.** Enter a name in the box under **Saved Sessions** , and click the **Save** button on the right.

![](https://cdn-learn.adafruit.com/assets/assets/000/048/985/medium800/circuitpython_PUTTY.png?1512750813)

Once your settings are entered, you're ready to connect to the serial console. Click "Open" at the bottom of the window. A new window will open.

![](https://cdn-learn.adafruit.com/assets/assets/000/048/986/medium800/circuitpython_PUTTYConsole.png?1512750813)

If no code is running, the window will either be blank or will look like the window above. Now you're ready to see the results of your code.

Great job! You've connected to the serial console!

# Windows 7 and 8.1

If you're using Windows 7 (or 8 or 8.1), you'll need to install drivers. See the [Windows 7 and 8.1 Drivers page](https://learn.adafruit.com/welcome-to-circuitpython/windows-7-and-8-1-drivers) for details. You will not need to install drivers on Mac, Linux or Windows 10 or 11.

# Adafruit MEMENTO Camera Board

## Advanced Serial Console on Mac

Connecting to the serial console on Mac does not require installing any drivers or extra software. You'll use a terminal program to find your board, and `screen` to connect to it. Terminal and `screen` both come installed by default.

## What's the Port?

First you'll want to find out which serial port your board is using. When you plug your board in to USB on your computer, it connects to a serial port. The port is like a door through which your board can communicate with your computer using USB.

The easiest way to determine which port the board is using is to first check **without** the board plugged in. Open Terminal and type the following:

`ls /dev/tty.*`

Each serial connection shows up in the `/dev/` directory. It has a name that starts with `tty.`. The command `ls` shows you a list of items in a directory. You can use `*` as a wildcard, to search for files that start with the same letters but end in something different. In this case, you're asking to see all of the listings in `/dev/` that start with `tty.` and end in anything. This will show us the current serial connections.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/012/medium800/circuitpython_MacCurrentSerialPorts.png?1512778572)

Now, plug your board. In Terminal, type:

`ls /dev/tty.*`

This will show you the current serial connections, which will now include your board.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/013/medium800/circuitpython_MacSerialPortswithBoard.png?1512778605)

A new listing has appeared called `/dev/tty.usbmodem141441`. The&nbsp;`tty.usbmodem141441` part of this listing is the name the example board is using. Yours will be called something similar.

Danger: Using the `screen` terminal program can cause your CircuitPython program to hang when trying to print, if you exit `screen` after you've used it to connect.

## macOS Serial Port Terminal Programs

- `screen` is included with macOS. However, it's problematic because when it starts up, it enables the using DTR/RTS flow control signals and does not turn that off when it quits. This causes CircuitPython to block sending output when `screen` has exited, which will cause your program to stall until it is reconnected. See [this issue](https://github.com/adafruit/circuitpython/issues/10814) for a discussion.
- `tio` is a nice terminal program that works properly. You can install it with [Homebrew](https://brew.sh/).
- VSCode has a number of serial port extensions, such as&nbsp;[Serial Monitor](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-serial-monitor).
- PyCharm has a&nbsp;&nbsp;[Serial Port Monitor](https://plugins.jetbrains.com/plugin/8031-serial-port-monitor) plugin.

## Connect with screen

Despite the caveats above, if you can't download a better terminal program, you can use `screen`. The `screen` command is included with MacOS. To connect to the serial console, use Terminal. Type the following command, replacing `board_name` with the name you found your board is using:

`screen /dev/tty.board_name 115200`

The first part of this establishes using the `screen` command. The second part tells screen the name of the board you're trying to use. The third part tells screen what baud rate to use for the serial connection. The baud rate is the speed in bits per second that data is sent over the serial connection. In this case, the speed required by the board is 115200 bits per second.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/014/medium800/circuitpython_ScreenCommandMac.png?1512778621 Comando screen en MacOS usando ruta de tarjeta de ejemplo)

Press enter to run the command. It will open in the same window. If no code is running, the window will be blank. Otherwise, you'll see the output of your code.

Great job! You've connected to the serial console!

# Adafruit MEMENTO Camera Board

## Advanced Serial Console on Linux

Connecting to the serial console on Linux does not require installing any drivers, but you may need to install `screen` using your package manager. You'll use a terminal program to find your board, and `screen` to connect to it. There are a variety of terminal programs such as gnome-terminal (called Terminal) or Konsole on KDE.

The `tio` program works as well to connect to your board, and has the benefit of automatically reconnecting. You would need to install it using your package manager.

## What's the Port?

First you'll want to find out which serial port your board is using. When you plug your board in to USB on your computer, it connects to a serial port. The port is like a door through which your board can communicate with your computer using USB.

The easiest way to determine which port the board is using is to first check **without** the board plugged in. Open your terminal program and type the following:

`ls /dev/ttyACM*`

Each serial connection shows up in the **/dev/** directory. It has a name that starts with **ttyACM**. The command `ls` shows you a list of items in a directory. You can use `*` as a wildcard, to search for files that start with the same letters but end in something different. In this case, You're asking to see all of the listings in **/dev/** that start with **ttyACM** `` and end in anything. This will show us the current serial connections.

In the example below, the error is indicating that are no current serial connections starting with **ttyACM**.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/715/medium800/circuitpython_WtCP_LinuxSerialNoBoard.png?1634829941)

Now plug in your board. In your terminal program, type:

`ls /dev/ttyACM*`

This will show you the current serial connections, which will now include your board.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/716/medium800/circuitpython_WtCP_LinuxSerialBoard.png?1634830018)

A new listing has appeared called **/dev/ttyACM0**. The **ttyACM0** part of this listing is the name the example board is using. Yours will be called something similar.

## Linux Serial Port Terminal Programs

- `tio`&nbsp;is a nice terminal program that works properly. You can install it using your package manager.
- VSCode has a number of serial port extensions, such as&nbsp;[Serial Monitor](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-serial-monitor).
- PyCharm has a&nbsp;&nbsp;[Serial Port Monitor](https://plugins.jetbrains.com/plugin/8031-serial-port-monitor)&nbsp;plugin.

## Connect with `tio`

Now that you know the name your board is using, you're ready connect to the serial console. Install `tio` using your package manager..

ype the following command, replacing&nbsp;`ttyACMx` with the name you found your board is using:

`tio /dev/ttyACMx`

This will connect to the serial port and display a header like this:

```terminal
$ tio /dev/ttyACM0
[11:07:00.578] tio v2.7
[11:07:00.578] Press ctrl-t q to quit
```

## Permissions on Linux

If you try to run `tio` and it doesn't work, then you may be running into an issue with permissions. Your Linux distribution may not allow access to serial ports by defaut. You may see something like this; note the "permission denied".

```terminal
[11:13:42.754] tio v2.7
[11:13:42.754] Press ctrl-t q to quit
[11:13:42.754] Warning: Could not open tty device (Permission denied)
[11:13:42.754] Waiting for tty device..
```

![](https://cdn-learn.adafruit.com/assets/assets/000/049/501/medium800/circuitpython_screen001.png?1513874862)

then you may need to grant yourself access. There are generally two ways you can do this. The first is to just run `screen` using the `sudo` command, which temporarily gives you elevated privileges.

```terminal
$ sudo tio /dev/ttyACM0
[sudo] password for smith:
```

Once you enter your password, you should be in:

![](https://cdn-learn.adafruit.com/assets/assets/000/049/503/medium800/circuitpython_screen004.png?1513875059)

The second way is to add yourself to the user group associated with the hardware. To figure out what that group is, use the command&nbsp;`ls -l` as shown below. The group name is circled in red.

Then use the command `adduser` to add yourself to that group. You need elevated privileges to do this, so you'll need to use `sudo`. In the example below, the group is **adm** and the user is **ackbar**.

On Debian-based distributions, such as,Ubuntu the group will be **dialout** , not **adm**.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/504/medium800/circuitpython_group.png?1513875136)

After you add yourself to the group, you'll need to logout and log back in, or in some cases, reboot your machine. After you log in again, verify that you have been added to the group using the command `groups`. If you are still not in the group, reboot and check again.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/505/medium800/circuitpython_screen006.png?1513875444)

And now you should be able to run `screen` without using `sudo`.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/506/medium800/circuitpython_screen007.png?1513875544)

And you're in:

![](https://cdn-learn.adafruit.com/assets/assets/000/049/507/medium800/circuitpython_screen004.png?1513875578)

# Adafruit MEMENTO Camera Board

## Frequently Asked Questions

These are some of the common questions regarding CircuitPython and CircuitPython microcontrollers.

### 
       
       
       
        What are some common acronyms to know? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

CP or CPy = [CircuitPython](https://circuitpython.org)  
CPC = [Circuit Playground Classic](https://www.adafruit.com/product/3000)&nbsp;(does not run CircuitPython)  
CPX = [Circuit Playground Express](https://www.adafruit.com/product/3333)  
CPB = [Circuit Playground Bluefruit](https://www.adafruit.com/product/4333)

## Using Older Versions
Danger: 

### I have to continue using CircuitPython 8.x or earlier. Where can I find compatible libraries?

**We are no longer building or supporting the CircuitPython 8.x or earlier library bundles. We highly encourage you to&nbsp;[update CircuitPython to the latest version](https://circuitpython.org/downloads)&nbsp;and use&nbsp;[the current version of the libraries](https://circuitpython.org/libraries).**&nbsp;However, if for some reason you cannot update, here are the last available library bundles for older versions:

- [2.x bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20190903/adafruit-circuitpython-bundle-2.x-mpy-20190903.zip)
- [3.x bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20190903/adafruit-circuitpython-bundle-3.x-mpy-20190903.zip)
- [4.x bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20200707/adafruit-circuitpython-bundle-4.x-mpy-20200707.zip)
- [5.x bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20210129/adafruit-circuitpython-bundle-5.x-mpy-20210129.zip)
- [6.x bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20211213/adafruit-circuitpython-bundle-6.x-mpy-20211213.zip)
- [7.x bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20231003/adafruit-circuitpython-bundle-7.x-mpy-20231003.zip)
- [8.x bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20250213/adafruit-circuitpython-bundle-8.x-mpy-20250213.zip)

## Python Arithmetic
### 
       
       
       
        Does CircuitPython support floating-point numbers? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

All CircuitPython boards support floating point arithmetic, even if the microcontroller chip does not support floating point in hardware. Floating point numbers are stored in 30 bits, with an 8-bit exponent and a 22-bit mantissa. Note that this is two bits less than standard 32-bit single-precision floats. You will get about 5-1/2 digits of decimal precision.&nbsp;

(The&nbsp; **broadcom** &nbsp;port may provide 64-bit floats in some cases.)

### 
       
       
       
        Does CircuitPython support long integers, like regular Python? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

Python long integers (integers of arbitrary size) are available on most builds, except those on boards with the smallest available firmware size. On these boards, integers are stored in 31 bits.

Boards without long integer support are mostly SAMD21 ("M0") boards without an external flash chip, such as the Adafruit Gemma M0, Trinket M0, QT Py M0, and the Trinkey series. There are also a number of third-party boards in this category. There are also a few small STM third-party boards without long integer support.

`time.localtime()`, `time.mktime()`, `time.time()`, and `time.monotonic_ns()` are available only on builds with long integers.

## Wireless Connectivity
### 
       
       
       
        How do I connect to the Internet with CircuitPython? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

If you'd like to include WiFi in&nbsp; your project, your best bet is to use a board that is running natively on ESP32 chipsets - those have WiFi built in!

If your development board has an SPI port and at least 4 additional pins, you can check out [this guide](https://learn.adafruit.com/adafruit-io-basics-airlift) on using AirLift with CircuitPython - extra wiring is required and some boards like the MacroPad or NeoTrellis do not have enough available pins to add the hardware support.

For further project examples, and guides about using AirLift with specific hardware, check out [the Adafruit Learn System](https://learn.adafruit.com/search?q=airlift).

### How do I do BLE (Bluetooth Low Energy) with CircuitPython?

nRF52840, nRF52833, and **as of CircuitPython 9.1.0** , ESP32, ESP32-C3, and ESP32-S3 boards (with 8MB) have the most complete BLE implementation. Your program can act as both a BLE central and peripheral. As a central, you can scan for advertisements, and connect to an advertising board. As a peripheral, you can advertise, and you can create services available to a central. Pairing and bonding are supported.

**Most Espressif boards with only 4MB of flash do not have enough room to include BLE in CircuitPython 9.** &nbsp; Check the [Module Support Matrix](https://docs.circuitpython.org/en/latest/shared-bindings/support_matrix.html) to see if your board has support for `_bleio`. CircuitPython 10 is planned to support `_bleio` on Espressif boards with 4MB flash.

Note that the ESP32-S2 does not have Bluetooth capability.

On most other boards with adequate firmware space, [BLE is available for use with AirLift](https://learn.adafruit.com/adafruit-airlift-breakout/circuitpython-ble) or other NINA-FW-based co-processors. Some boards have this coprocessor on board, such as the [PyPortal](https://learn.adafruit.com/adafruit-pyportal/circuitpython-ble). Currently, this implementation only supports acting as a BLE peripheral. Scanning and connecting as a central are not yet implemented. Bonding and pairing are not supported.

### 
       
       
       
        Are there other ways to communicate by radio with CircuitPython? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

Check out [Adafruit's RFM boards](https://www.adafruit.com/?q=rfm&sort=BestMatch)for simple radio communication supported by CircuitPython, which can be used over distances of 100m to over a km, depending on the version. The RFM SAMD21 M0 boards can be used, but they were not designed for CircuitPython, and have limited RAM and flash space; using the RFM breakouts or FeatherWings with more capable boards will be easier.

## Asyncio and Interrupts
### 
       
       
       
        Is there asyncio support in CircuitPython? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

There is support for asyncio starting with CircuitPython 7.1.0, on all boards except the smallest SAMD21 builds. Read about using it in the [Cooperative Multitasking in CircuitPython](https://learn.adafruit.com/cooperative-multitasking-in-circuitpython) Guide.

### 
       
       
       
        Does CircuitPython support interrupts? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

No. CircuitPython does not currently support interrupts - please use asyncio for multitasking / 'threaded' control of your code

## Status RGB LED
### 
       
       
       
        My RGB NeoPixel/DotStar LED is blinking funny colors - what does it mean? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

The status LED can tell you what's going on with your CircuitPython board. [Read more here for what the colors mean!](https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#circuitpython-rgb-status-light-2978455-24)

## Memory Issues
### 
       
       
       
        What is a MemoryError? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

Memory allocation errors happen when you're trying to store too much on the board. The CircuitPython microcontroller boards have a limited amount of memory available. You can have about 250 lines of code on the M0 Express boards. If you try to `import` too many libraries, a combination of large libraries, or run a program with too many lines of code, your code will fail to run and you will receive a `MemoryError` in the serial console.

### 
       
       
       
        What do I do when I encounter a MemoryError? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

Try resetting your board. Each time you reset the board, it reallocates the memory. While this is unlikely to resolve your issue, it's a simple step and is worth trying.

Make sure you are using **.mpy** versions of libraries. All of the CircuitPython libraries are available in the bundle in a **.mpy** format which takes up less memory than **.py** format. Be sure that you're using [the latest library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases) for your version of CircuitPython.

If that does not resolve your issue, try shortening your code. Shorten comments, remove extraneous or unneeded code, or any other clean up you can do to shorten your code. If you're using a lot of functions, you could try moving those into a separate library, creating a **.mpy** of that library, and importing it into your code.

You can turn your entire file into a **.mpy** and `import` that into **code.py**. This means you will be unable to edit your code live on the board, but it can save you space.

### 
       
       
       
        Can the order of my <code class=

It can because the memory gets fragmented differently depending on allocation order and the size of objects. Loading **.mpy** files uses less memory so its recommended to do that for files you aren't editing.

### How can I create my own <strong>.mpy</strong> files?

You can make your own **.mpy** versions of files with `mpy-cross`.

You can download **mpy-cross** for your operating system from [here](https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross/). Builds are available for Windows, macOS, x64 Linux, and Raspberry Pi Linux. Choose the latest **mpy-cross** whose version matches the version of CircuitPython you are using.

On macOS and Linux, after you download&nbsp; **mpy-cross** , you must make the the file executable by doing `chmod +x name-of-the-mpy-cross-executable`.

To make a **.mpy** file, run `./mpy-cross path/to/yourfile.py` to create a **yourfile.mpy** in the same directory as the original file.

### 
       
       
       
        How do I check how much memory I have free? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

Run the following to see the number of bytes available for use:

`import gc`  
`gc.mem_free()`

## Unsupported Hardware
### 
       
       
       
        Is ESP8266 or ESP32 supported in CircuitPython? Why not? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

We dropped ESP8266 support as of 4.x - For more information please read about it [here](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-for-esp8266)!

[As of CircuitPython 8.x we have started to support ESP32 and ESP32-C3 and have added a WiFi workflow for wireless coding!](https://learn.adafruit.com/circuitpython-with-esp32-quick-start)

We also support ESP32-S2 & ESP32-S3, which have native USB.

### 
       
       
       
        Does Feather M0 support WINC1500? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

No, WINC1500 will not fit into the M0 flash space.

### 
       
       
       
        Can AVRs such as ATmega328 or ATmega2560 run CircuitPython? 
 
       
        
       
     
       
        
       
     
       
        
       
     
       
        
       
    

No.

# Adafruit MEMENTO Camera Board

## Troubleshooting

From time to time, you will run into issues when working with CircuitPython. Here are a few things you may encounter and how to resolve them.

Danger: 

# Always Run the Latest Version of CircuitPython and Libraries

As CircuitPython development continues and there are new releases, Adafruit will stop supporting older releases. **You need to [update to the latest CircuitPython](https://circuitpython.org/downloads).**

You need to download the CircuitPython Library Bundle that matches your version of CircuitPython. **Please update CircuitPython and then [download the latest bundle](https://circuitpython.org/libraries)**.

As new versions of CircuitPython are released, Adafruit will stop providing the previous bundles as automatically created downloads on the Adafruit CircuitPython Library Bundle repo. If you must continue to use an earlier version, you can still download the appropriate version of `mpy-cross` from the particular release of CircuitPython on the CircuitPython repo and create your own compatible .mpy library files. **However, it is best to update to the latest for both CircuitPython and the library bundle.**

## I have to continue using CircuitPython 7.x or earlier. Where can I find compatible libraries?

**Adafruit is no longer building or supporting the CircuitPython 7.x or earlier library bundles. You are highly encourged to [update CircuitPython to the latest version](https://circuitpython.org/downloads) and use [the current version of the libraries](https://circuitpython.org/libraries).** However, if for some reason you cannot update, links to the previous bundles are available in the [FAQ](https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions#faq-3105289).

# macOS Sonoma before 14.4: Errors Writing to CIRCUITPY macOS 14.4 - 15.1: Slow Writes to CIRCUITPY

macOS Sonoma before 14.4 took many seconds to complete writes to small FAT drives, 8MB or smaller. This causes errors when writing to CIRCUITPY. The best solution was to remount the CIRCUITPY drive after it is automatically mounted. Or consider downgrading back to Ventura if that works for you. This problem was tracked in [CircuitPython GitHub issue 8449](https://github.com/adafruit/circuitpython/issues/8449).

Below is a shell script to do this remount conveniently (courtesy [@czei in GitHub](https://github.com/adafruit/circuitpython/issues/8449#issuecomment-1779981373)). Copy the code here into a file named, say, **remount-CIRCUITPY.sh**. Place the file in a directory on your PATH, or in some other convenient place.

macOS Sonoma 14.4 and versions of macOS before Sequoia 15.2 did not have the problem above, but did&nbsp; take an inordinately long time to write to FAT drives of size 1GB or less (40 times longer than 2GB drives). As of macOS 15.2, writes are no longer very slow. This problem was tracked in&nbsp;[CircuitPython GitHub issue 8918](https://github.com/adafruit/circuitpython/issues/8918).

```auto
#!/bin/sh
#
# This works around bug where, by default,
# macOS 14.x before 14.4 writes part of a file immediately,
# and then doesn't update the directory for 20-60 seconds, causing
# the file system to be corrupted.
#

disky=`df | grep CIRCUITPY | cut -d" " -f1`
sudo umount /Volumes/CIRCUITPY
sudo mkdir /Volumes/CIRCUITPY
sleep 2
sudo mount -v -o noasync -t msdos $disky /Volumes/CIRCUITPY
```

Then in a Terminal window, do this to make this script executable:

```terminal
chmod +x remount-CIRCUITPY.sh
```

Place the file in a directory on your `PATH`, or in some other convenient place.

Now, each time you plug in or reset your CIRCUITPY board, run the file **remount-CIRCUITPY.sh**. You can run it in a Terminal window or you may be able to place it on the desktop or in your dock to run it just by double-clicking.

This will be something of a nuisance but it is the safest solution.

This problem is being tracked in [this CircuitPython issue](https://github.com/adafruit/circuitpython/issues/8449).

# Bootloader (_boardname_BOOT) Drive Not Present

### **You may have a different board.**

Only Adafruit Express boards and the SAMD21 non-Express boards ship with the [UF2 bootloader](../../../adafruit-feather-m0-express-designed-for-circuit-python-circuitpython/uf2-bootloader?view=all#uf2-bootloader)installed. The Feather M0 Basic, Feather M0 Adalogger, and similar boards use a regular Arduino-compatible bootloader, which does not show a **_boardname_BOOT** drive.

### **MakeCode**

If you are running a [MakeCode](../../../makecode/sharing-and-saving?view=all#step-1-bootloader-mode) program on Circuit Playground Express, press the reset button just once&nbsp;to get the **CPLAYBOOT** drive to show up. Pressing it twice will not work.

### **macOS**

**DriveDx** and its accompanything **SAT SMART Driver** can interfere with seeing the BOOT drive. [See this forum post](https://forums.adafruit.com/viewtopic.php?f=58&t=161917&p=799309#p799215) for how to fix the problem.

### **Windows 10 or later**

Did you install the Adafruit Windows Drivers package by mistake, or did you upgrade to Windows 10 or later with the driver package installed? You don't need to install this package on Windows 10 or 11for most Adafruit boards. The old version (v1.5) can interfere with recognizing your device. Go to **Settings** -\> **Apps** and uninstall all the "Adafruit" driver programs.

### **Windows 7 or 8.1**

Windows 7 and 8.1 have reached end of life. It is&nbsp;[recommended](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython#windows-7-and-8-dot-1-drivers-2977910-9) that you upgrade to Windows 10 or 11 if possible. Drivers are available for some older CircuitPython boards, but there are no plans to release drivers for newer boards.

Info: The Windows Drivers installer was last updated in November 2020 (v2.5.0.0) . Windows 7 drivers for CircuitPython boards released since then, including RP2040 boards, are not available. There are no plans to release drivers for newer boards. The boards work fine on Windows 10 and later.

You should now be done! Test by unplugging and replugging the board. You should see the **CIRCUITPY** drive, and when you double-click the reset button (single click on Circuit Playground Express running MakeCode), you should see the appropriate&nbsp; **_boardname_BOOT** drive.

Let us know in the [Adafruit support forums](https://forums.adafruit.com) or on the [Adafruit Discord](https://adafru.it/discord) if this does not work for you!

# Windows Explorer Locks Up When Accessing **_boardname_BOOT** Drive

On Windows, several third-party programs that can cause issues. The symptom is that you try to access the **_boardname_BOOT** &nbsp;drive, and Windows or Windows Explorer seems to lock up. These programs are known to cause trouble:

- **AIDA64** : to fix, stop the program. This problem has been reported to AIDA64. They acquired hardware to test, and released a beta version that fixes the problem. This may have been incorporated into the latest release. Please let us know in the forums if you test this.
- **BitDefender anti-virus**
- **Hard Disk Sentinel**
- **Kaspersky anti-virus** : To fix, you may need to disable Kaspersky completely. Disabling some aspects of Kaspersky does not always solve the problem. This problem has been reported to Kaspersky.
- **ESET NOD32 anti-virus** : There have been problems with at least version 9.0.386.0, solved by uninstallation.

# Copying UF2 to **_boardname_BOOT** Drive Hangs at 0% Copied

On Windows, a **Western DIgital (WD) utility** that comes with their external USB drives can interfere with copying UF2 files to the **_boardname_BOOT** drive. Uninstall that utility to fix the problem.

# CIRCUITPY Drive Does Not Appear or Disappears Quickly

**BitDefender anti-virus has been reported to block access to**  **CIRCUITPY**. You can set an exception for the drive letter.

Kaspersky&nbsp; **anti-virus** can block the appearance of the **CIRCUITPY** drive. There has not yet been settings change discovered that prevents this. Complete uninstallation of Kaspersky fixes the problem.

**Norton anti-virus** can interfere with **CIRCUITPY**. A user has reported this problem on Windows 7. The user turned off both Smart Firewall and Auto Protect, and **CIRCUITPY** then appeared.

**Sophos Endpoint** security software [can cause CIRCUITPY to disappear](https://forums.adafruit.com/viewtopic.php?f=60&t=187629) and the BOOT drive to reappear. It is not clear what causes this behavior.

**Samsung Magician** can cause CIRCUITPY to disappear (reported [here](https://forums.adafruit.com/viewtopic.php?t=205159) and [here](https://forums.adafruit.com/viewtopic.php?p=987596#p987596)).

## "M105" Seen on Display, Crashes, Missing CIRCUITPY

The **Cura** 3D printing program sends 3D printing GCODE commands to unused serial ports to try to find 3D printers connected over serial. This causes a variety of problems. Disable (uncheck) **USB Printing** in Cura in the **Market** -\> **Installed** menu, or uninstall Cura. For more information see [this forum post](https://forums.adafruit.com/viewtopic.php?t=192784), [this CircuitPython issue](https://github.com/adafruit/circuitpython/issues/2585), and [this Cura issue](https://github.com/Ultimaker/Cura/issues/5207).

# Device Errors or Problems on Windows

Windows can become confused about USB device installations.&nbsp;Try cleaning up your USB devices. Use [Uwe Sieber's Device Cleanup Tool](https://www.uwe-sieber.de/misc_tools_e.html)&nbsp;(on that page, scroll down to "Device Cleanup Tool"). Download and unzip the tool. Unplug all the boards and other USB devices you want to clean up. Run the tool as Administrator. You will see a listing like this, probably with many more devices. It is listing all the USB devices that are _not_ currently attached.

![](https://cdn-learn.adafruit.com/assets/assets/000/104/840/medium800/circuitpython_device-cleanup-tool.png?1632502330)

Select all the devices you want to remove, and then press Delete. It is usually safe just to select everything. Any device that is removed will get a fresh install when you plug it in. Using the Device Cleanup Tool also discards all the COM port assignments for the unplugged boards. If you have used many Arduino and CircuitPython boards, you have probably seen higher and higher COM port numbers used, seemingly without end. This will fix that problem.

# Serial Console in Mu Not Displaying Anything

There are times when the serial console will accurately not display anything, such as, when no code is currently running, or when code with no serial output is already running before you open the console. However, if you find yourself in a situation where you feel it should be displaying something like an error, consider the following.

Depending on the size of your screen or Mu window, when you open the serial console, the serial console panel may be very small. This can be a problem. A basic CircuitPython error takes 10 lines to display!

```
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 7
SyntaxError: invalid syntax



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

More complex errors take even more lines!

Therefore, if your serial console panel is five lines tall or less, you may only see blank lines or blank lines followed by `Press any key to enter the REPL. Use CTRL-D to reload.`. If this is the case, you need to either mouse over the top of the panel to utilise the option to resize the serial panel, or use the scrollbar on the right side to scroll up and find your message.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/358/medium800/circuitpython_Mu_Serial_Short.png?1541708969)

This applies to any kind of serial output whether it be error messages or print statements. So before you start trying to debug your problem on the hardware side, be sure to check that you haven't simply missed the serial messages due to serial output panel height.

# code.py Restarts Constantly

CircuitPython will restart **code.py** if you or your computer writes to something on the CIRCUITPY drive. This feature is called _auto-reload_, and lets you test a change to your program immediately.

Some utility programs, such as backup, anti-virus, or disk-checking apps, will write to the CIRCUITPY as part of their operation. Sometimes they do this very frequently, causing constant restarts.

**Acronis True Image** and related Acronis programs on Windows are known to cause this problem. It is possible to prevent this by [disabling the "](https://forum.acronis.com/forum/acronis-true-image-2018-forum/acronis-ati-2018-contantly-touch-usb-port-causing-issue-adafruit-circuitpython-folder)[Acronis Managed Machine Service Mini"](https://forum.acronis.com/forum/acronis-true-image-2018-forum/acronis-ati-2018-contantly-touch-usb-port-causing-issue-adafruit-circuitpython-folder).

If you cannot stop whatever is causing the writes, you can disable auto-reload by putting this code in **boot.py** or **code.py** :

```python
import supervisor

supervisor.runtime.autoreload = False
```

# CircuitPython RGB Status Light

Nearly all CircuitPython-capable boards have a single NeoPixel or DotStar RGB LED on the board that indicates the status of CircuitPython. A few boards designed before CircuitPython existed, such as the Feather M0 Basic, do not.

**Circuit Playground Express and Circuit Playground Bluefruit have multiple RGB LEDs, but do NOT have a status LED. The LEDs are all green when in the bootloader. In versions before 7.0.0, they do NOT indicate any status while running CircuitPython.**

## **CircuitPython 7.0.0 and Later**

The status LED blinks were changed in CircuitPython 7.0.0 in order to save battery power and simplify the blinks. These blink patterns will occur on single color LEDs when the board does not have any RGB LEDs. Speed and blink count also vary for this reason.

On start up, the LED will blink **YELLOW** multiple times for 1 second. Pressing the RESET button (or on Espressif, the BOOT button) during this time will restart the board and then enter safe mode. On Bluetooth capable boards, after the yellow blinks, there will be a set of faster blue blinks. Pressing reset during the **BLUE** blinks will clear Bluetooth information and start the device in discoverable mode, so it can be used with a BLE code editor.

Once started, CircuitPython will blink a pattern every 5 seconds when no user code is running to indicate why the code stopped:

- 1 **GREEN** blink: Code finished without error.
- 2 **RED** blinks:&nbsp;Code ended due to an exception. Check the serial console for details.
- 3 **YELLOW** blinks:&nbsp;CircuitPython is in safe mode. No user code was run. Check the serial console for safe mode reason.

When in the REPL, CircuitPython will set the status LED to **WHITE**. You can change the LED color from the REPL. The status indicator will not persist on non-NeoPixel or DotStar LEDs.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/229/medium800/circuitpython_CircuitPython_Boot_Sequence_7.jpg?1636133436)

## **CircuitPython 6.3.0 and earlier**

Here's what the colors and blinking mean:

- steady **GREEN** : **code.py** (or **code.txt** , **main.py** , or **main.txt** ) is running
- pulsing **GREEN** : **code.py** (etc.) has finished or does not exist
- steady **YELLOW** at start up: (4.0.0-alpha.5 and newer) CircuitPython is waiting for a reset to indicate that it should start in safe mode
- pulsing **YELLOW** : Circuit Python is in safe mode: it crashed and restarted
- steady **WHITE** : REPL is running
- steady **BLUE** : **boot.py** is running

Colors with multiple flashes following indicate a Python&nbsp;exception and then indicate the line number of the error. The color of the first flash indicates the type of error:

- **GREEN** :&nbsp;IndentationError
- **CYAN** :&nbsp;SyntaxError
- **WHITE** : NameError
- **ORANGE** : OSError
- **PURPLE** : ValueError
- **YELLOW** : other error

These are followed by flashes indicating the line number, including place value. **WHITE** flashes are thousands' place, **BLUE** are hundreds' place, **YELLOW** are tens' place, and **CYAN** are one's place. So for example, an error on line 32 would flash **YELLOW** three times and then **CYAN** two times. Zeroes are indicated by an extra-long dark gap.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/228/medium800/circuitpython_CircuitPython_Boot_Sequence_1.png?1636133360)

# Serial console showing `ValueError: Incompatible .mpy file`

This error occurs when importing a module that is stored as a **.mpy** binary file that was generated by a different version of CircuitPython than the one its being loaded into. In particular, the mpy binary format changed between CircuitPython versions 6.x and 7.x, 2.x and 3.x, and 1.x and 2.x.

So, for instance, if you upgraded to CircuitPython 7.x from 6.x you’ll need to download a newer version of the library that triggered the error on `import`. All libraries are available in the [Adafruit bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest).

# CIRCUITPY Drive Issues

You may find that you can no longer save files to your **CIRCUITPY** drive. You may find that your **CIRCUITPY** stops showing up in your file explorer, or shows up as **NO\_NAME**. These are indicators that your filesystem has issues. When the **CIRCUITPY** disk is not safely ejected before being reset by the button or being disconnected from USB, it may corrupt the flash drive. It can happen on Windows, Mac or Linux, though it is more common on Windows.

Be aware, if you have used Arduino to program your board, CircuitPython is no longer able to provide the USB services. You will need to reload CircuitPython to resolve this situation.

The easiest first step is to reload CircuitPython. Double-tap reset on the board so you get a **_boardname_BOOT** drive rather than a **CIRCUITPY** drive, and copy the latest version of CircuitPython ( **.uf2** ) back to the board. This may restore **CIRCUITPY** functionality.

If reloading CircuitPython does not resolve your issue, the next step is to try putting the board into safe mode.

## Safe Mode

Whether you've run into a situation where you can no longer edit your **code.py** on your **CIRCUITPY** drive, your board has gotten into a state where **CIRCUITPY** is read-only, or you have turned off the **CIRCUITPY** drive altogether, 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 in CircuitPython 7.x and Later

You can enter safe by pressing reset during the right time when the board boots. Immediately after the board starts up or resets, it waits one second. On some boards, the onboard status LED will blink yellow during that time. If you press reset during that one second period, 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.)

### Entering Safe Mode in CircuitPython 6.x

You can enter safe by pressing reset during the right time when the board boots.. Immediately after the board starts up or resets, it waits 0.7 seconds. On some boards, the onboard status LED (highlighted in green above) will turn solid yellow during this time. If you press reset during that 0.7 seconds, 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

Once you've entered safe mode successfully in CircuitPython 6.x, the LED will pulse yellow.

If you successfully enter safe mode on CircuitPython 7.x, 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._

At this point, you'll want to remove any user code in&nbsp; **code.py** and, if present, the **boot.py** file from **CIRCUITPY**. Once removed, tap the reset button, or unplug and plug in your board, to restart CircuitPython. This will restart the board and may resolve your drive issues. If resolved, you can begin coding again as usual.

If safe mode does not resolve your issue, the board must be completely erased and CircuitPython must be reloaded onto the board.

Danger: 

## To erase CIRCUITPY: `storage.erase_filesystem()`

CircuitPython includes a built-in function to erase and reformat the filesystem. If you have a version of CircuitPython older than 2.3.0 on your board, you can [update to the newest version](../../../../welcome-to-circuitpython/installing-circuitpython) to do this.

1. [Connect to the CircuitPython REPL](../../../../welcome-to-circuitpython/kattni-connecting-to-the-serial-console)&nbsp;using Mu or a terminal program.
2. Type the following into the REPL:

```terminal
&gt;&gt;&gt; import storage
&gt;&gt;&gt; storage.erase_filesystem()
```

CIRCUITPY will be erased and reformatted, and your board will restart. That's it!

## Erase CIRCUITPY Without Access to the REPL

If you can't access the REPL, or you're running a version of CircuitPython previous to 2.3.0 and you don't want to upgrade, there are options available for some specific boards.

**The options listed below are considered to be the "old way" of erasing your board. The method shown above using the REPL is highly recommended as the best method for erasing your board.**

Warning: 

## For the specific boards listed below:

If the board you are trying to erase is listed below, follow the steps to use the file to erase your board.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.&nbsp; Download the correct erase file:

[Circuit Playground Express](https://cdn-learn.adafruit.com/assets/assets/000/048/745/original/flash_erase_express.ino.circuitplay.uf2?1512152080)
[Feather M0 Express](https://cdn-learn.adafruit.com/assets/assets/000/048/746/original/flash_erase_express.ino.feather_m0_express.uf2?1512152098)
[Feather M4 Express](https://cdn-learn.adafruit.com/assets/assets/000/076/217/original/flash_erase.ino.feather_m4.uf2)
[Metro M0 Express](https://cdn-learn.adafruit.com/assets/assets/000/048/747/original/flash_erase_express.ino.metro_m0.uf2?1512152103)
[Metro M4 Express QSPI Eraser](https://cdn-learn.adafruit.com/assets/assets/000/073/820/original/Metro_M4_QSPI_Eraser.UF2?1553805937)
[Trellis M4 Express (QSPI)](https://cdn-learn.adafruit.com/assets/assets/000/067/535/original/Trellis_M4_QSPI_Eraser.UF2?1544719380)
[Grand Central M4 Express (QSPI)](https://cdn-learn.adafruit.com/assets/assets/000/069/314/original/GC_M4_QSPI_Erase.UF2?1547404471)
[PyPortal M4 Express (QSPI)](https://cdn-learn.adafruit.com/assets/assets/000/072/252/original/PYPORTAL_QSPI_Eraser.UF2?1551738305)
[Circuit Playground Bluefruit (QSPI)](https://cdn-learn.adafruit.com/assets/assets/000/082/950/original/CP_Bluefruit_QSPI_Erase.UF2?1572026649)
[Monster M4SK (QSPI)](https://cdn-learn.adafruit.com/assets/assets/000/083/330/original/M4SK_QSPI_Eraser.UF2?1572551433)
[PyBadge/PyGamer QSPI Eraser.UF2](https://cdn-learn.adafruit.com/assets/assets/000/083/331/original/PyBadge_QSPI_Eraser.UF2?1572551613)
[CLUE_Flash_Erase.UF2](https://cdn-learn.adafruit.com/assets/assets/000/088/454/original/CLUE_Flash_Erase.UF2?1581873830)
[Matrix_Portal_M4_(QSPI).UF2](https://cdn-learn.adafruit.com/assets/assets/000/098/741/original/Matrix_Portal_M4_%28QSPI%29.UF2?1611076081)
[RP2040 boards (flash_nuke.uf2)](https://cdn-learn.adafruit.com/assets/assets/000/101/659/original/flash_nuke.uf2)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.&nbsp; Double-click the reset button on the board to bring up the **_boardname_BOOT** drive.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.&nbsp; Drag the erase **.uf2** file to the&nbsp; **_boardname_BOOT** drive.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4.&nbsp; The status LED will turn yellow or blue, indicating the erase has started.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5.&nbsp; After approximately 15 seconds, the status LED will light up green. On the NeoTrellis M4 this is the first NeoPixel on the grid  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6.&nbsp; Double-click the reset button on the board to bring up the&nbsp; **_boardname_BOOT** &nbsp;drive.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7.&nbsp; [Drag the appropriate latest release of CircuitPython](https://circuitpython.org/downloads) **.uf2** file to the&nbsp; **_boardname_BOOT** &nbsp;drive.

It should reboot automatically and you should see **CIRCUITPY** in your file explorer again.

If the LED flashes red during step 5, it means the erase has failed. Repeat the steps starting with 2.

[If you haven't already downloaded the latest release of CircuitPython for your board, check out the installation page](../../../../welcome-to-circuitpython/installing-circuitpython). You'll also need to load your code and reinstall your libraries!

## For SAMD21 non-Express boards that have a UF2 bootloader:

Any SAMD21-based microcontroller that does not have external flash available is considered a SAMD21 non-Express board. Non-Express boards that have a UF2 bootloader include Trinket M0, GEMMA M0, QT Py M0, and the SAMD21-based Trinkey boards.

If you are trying to erase a SAMD21 non-Express board, follow these steps to erase your board.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.&nbsp; Download the erase file:

[SAMD21 non-Express Boards](https://cdn-learn.adafruit.com/assets/assets/000/048/748/original/erase_m0.uf2)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.&nbsp; Double-click the reset button on the board to bring up the **_boardname_BOOT** drive.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.&nbsp; Drag the erase **.uf2** file to the **_boardname_BOOT** drive.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4.&nbsp; The boot LED will start flashing again, and the **_boardname_BOOT** drive will reappear.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5.&nbsp; [Drag the appropriate latest release CircuitPython](https://circuitpython.org/downloads) **.uf2** file to the _boardname_BOOT drive.

It should reboot automatically and you should see **CIRCUITPY** in your file explorer again.

[If you haven't already downloaded the latest release of CircuitPython for your board, check out the installation page](../../../../welcome-to-circuitpython/installing-circuitpython) YYou'll also need to load your code and reinstall your libraries!

## For SAMD21 non-Express boards that do not have a UF2 bootloader:

Any SAMD21-based microcontroller that does not have external flash available is considered a SAMD21 non-Express board. Non-Express boards that do **not** have a UF2 bootloader include the Feather M0 Basic Proto, Feather Adalogger, or the Arduino Zero.

If you are trying to erase a non-Express board that does not have a UF2 bootloader, [follow these directions to&nbsp;reload CircuitPython using `bossac`](../../../../welcome-to-circuitpython/non-uf2-installation), which will erase and re-create **CIRCUITPY**.

# Running Out of File Space on SAMD21 Non-Express Boards

Any SAMD21-based microcontroller that does not have external flash available is considered a SAMD21 non-Express board. This includes boards like the Trinket M0, GEMMA M0, QT Py M0, and the SAMD21-based Trinkey boards.

The file system on the board is very tiny. (Smaller than an ancient floppy disk.) So, its likely you'll run out of space but don't panic! There are a number of ways to free up space.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/465/medium800/circuitpython_arduino_compatibles_gemma_out_of_space.png?1513737132)

## Delete something!

The simplest way of freeing up space is to delete files from the drive. Perhaps there are libraries in the **lib** folder that you aren't using anymore or test code that isn't in use. Don't delete the **lib** folder completely, though, just remove what you don't need.

The board ships with the Windows 7 serial driver too! Feel free to delete that if you don't need it or have already installed it. It's ~12KiB or so.

## Use tabs

One unique feature of Python is that the indentation of code matters. Usually the recommendation is to indent code with four spaces for every indent. In general, that is recommended too. **However** , one trick to storing more human-readable code is to use a single tab character for indentation. This approach uses 1/4 of the space for indentation and can be significant when you're counting bytes.

## On macOS?

MacOS loves to generate hidden files. Luckily you can disable some of the extra hidden files that macOS adds by running a few commands to disable search indexing and create zero byte placeholders. Follow the steps below to maximize the amount of space available on macOS.

## Prevent & Remove macOS Hidden Files

First find the volume name for your board. &nbsp;With the board plugged in run this command in a terminal to list all the volumes:

```
ls -l /Volumes
```

Look for a volume with a name like&nbsp; **CIRCUITPY** &nbsp;(the default for CircuitPython). &nbsp;The full path to the volume is the&nbsp; **/Volumes/CIRCUITPY** &nbsp;path.

Now follow the&nbsp;[steps from this question](http://apple.stackexchange.com/questions/6707/how-to-stop-os-x-from-writing-spotlight-and-trash-files-to-memory-cards-and-usb/7135#7135)&nbsp;to run these terminal commands that stop hidden files from being created on the board:

```terminal
mdutil -i off /Volumes/CIRCUITPY
cd /Volumes/CIRCUITPY
rm -rf .{,_.}{fseventsd,Spotlight-V*,Trashes}
mkdir .fseventsd
touch .fseventsd/no_log .metadata_never_index .Trashes
cd -
```

Replace&nbsp; **/Volumes/CIRCUITPY** &nbsp;in the commands above with the full path to your board's volume if it's different. &nbsp;At this point all the hidden files should be cleared from the board and some hidden files will be prevented from being created.

Alternatively, with CircuitPython 4.x and above, the special files and folders mentioned above will be created automatically if you erase and reformat the filesystem. **WARNING: Save your files first!** Do this in the REPL:

`>>> import storage`  
`>>> storage.erase_filesystem()`

However there are still some cases where hidden files will be created by MacOS. &nbsp;In particular if you copy a file that was downloaded from the internet it will have special metadata that MacOS stores as a hidden file. &nbsp;Luckily you can run a copy command from the terminal to copy files **without** this hidden metadata file. &nbsp;See the steps below.

## Copy Files on macOS Without Creating Hidden Files

Once you've disabled and removed hidden files with the above commands on macOS you need to be careful to copy files to the board with a special command that prevents future hidden files from being created. &nbsp;Unfortunately you **cannot** &nbsp;use drag and drop copy in Finder because it will still create these hidden extended attribute files in some cases (for files downloaded from the internet, like Adafruit's modules).

To copy a file or folder use the&nbsp; **-X** &nbsp;option for the&nbsp; **cp** &nbsp;command in a terminal. &nbsp;For example to copy a **file\_name.mpy** file to the board use a command like:

```terminal
cp -X file_name.mpy /Volumes/CIRCUITPY
```

(Replace **file\_name.mpy** with the name of the file you want to copy.)

Or to copy a folder and all of the files and folders contained within, use a command like:

```terminal
cp -rX folder_to_copy /Volumes/CIRCUITPY
```

If you are copying to the **lib** folder, or another folder, make sure it exists before copying.

```terminal
# if lib does not exist, you'll create a file named lib !
cp -X file_name.mpy /Volumes/CIRCUITPY/lib
# This is safer, and will complain if a lib folder does not exist.
cp -X file_name.mpy /Volumes/CIRCUITPY/lib/
```

## Other macOS Space-Saving Tips

If you'd like to see the amount of space used on the drive and manually delete hidden files here's how to do so. First, move into the **Volumes/** directory with `cd /Volumes/`, and then list the amount of space used on the **CIRCUITPY** drive with the `df` command.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/974/medium800/circuitpython_WtCP_df_CIRCUITPY.png?1635456335)

That's not very much space left! The next step is to show a list of the files currently on the **CIRCUITPY** drive, _including_ the hidden files, using the `ls` command. You cannot use Finder to do this, you must do it via command line!

![](https://cdn-learn.adafruit.com/assets/assets/000/105/975/medium800/circuitpython_WtCP_ls_CIRCUITPY.png?1635456430)

There are a few of the hidden files that MacOS loves to generate, all of which begin with a **.\_** before the file name. Remove the **.\_** files using the `rm` command. You can remove them all once by running `rm CIRCUITPY/._*`. The `*` acts as a _wildcard_ to apply the command to everything that begins with **.\_** at the same time.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/976/medium800/circuitpython_WtCP_rm_dot_underscore_CIRCUITPY.png?1635456716)

Finally, you can run `df` again to see the current space used.

![](https://cdn-learn.adafruit.com/assets/assets/000/105/977/medium800/circuitpython_WtCP_df_post_delete_CIRCUITPY.png?1635456812)

Nice! You have 12Ki more than before! This space can now be used for libraries and code!

# Device Locked Up or Boot Looping

In rare cases, it may happen that something in your **code.py** or **boot.py** files causes the device to get locked up, or even go into a boot loop. A _boot loop_ occurs when the board reboots repeatedly and never fully loads. These are not caused by your everyday Python exceptions, typically it's the result of a deeper problem within CircuitPython. In this situation, it can be difficult to recover your device if **CIRCUITPY** is not allowing you to modify the **code.py** or **boot.py** files. Safe mode is one recovery option. When the device boots up in safe mode it will not run the **code.py** or **boot.py** scripts, but will still connect the **CIRCUITPY** drive so that you can remove or modify those files as needed.

For more information on safe mode and how to enter safe mode, see the [Safe Mode section on this page](https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#safe-mode-3105351).

# Adafruit MEMENTO Camera Board

## Welcome to the Community!

![](https://cdn-learn.adafruit.com/assets/assets/000/047/545/medium800/circuitpython_adafruit_code_community_googleplus.jpg?1508879596)

CircuitPython is a programming language that's super simple to get started with and great for learning. It runs on microcontrollers and works out of the box. You can plug it in and get started with any text editor. The best part? CircuitPython comes with an amazing, supportive community.

Everyone is welcome! CircuitPython is Open Source. This means it's available for anyone to use, edit, copy and improve upon. This also means CircuitPython becomes better because of you being a part of it. Whether this is your first microcontroller board or you're a seasoned software engineer, you have something important to offer the Adafruit CircuitPython community. This page highlights some of the many ways you can be a part of it!

## Adafruit Discord
![](https://cdn-learn.adafruit.com/assets/assets/000/048/351/medium800/circuitpython_Screen_Shot_2017-11-20_at_14.54.21.png?1511207983)

The Adafruit Discord server is the best place to start. Discord is where the community comes together to volunteer and provide live support of all kinds. From general discussion to detailed problem solving, and everything in between, Discord is a digital maker space with makers from around the world.

There are many different channels so you can choose the one best suited to your needs. Each channel is shown on Discord as "#channelname". There's the #help-with-projects channel for assistance with your current project or help coming up with ideas for your next one. There's the #show-and-tell channel for showing off your newest creation. Don't be afraid to ask a question in any channel! If you're unsure, #general is a great place to start. If another channel is more likely to provide you with a better answer, someone will guide you.

The help with CircuitPython channel is where to go with your CircuitPython questions. #help-with-circuitpython is there for new users and developers alike so feel free to ask a question or post a comment! Everyone of any experience level is welcome to join in on the conversation. Your contributions are important! The #circuitpython-dev channel is available for development discussions as well.

The easiest way to contribute to the community is to assist others on Discord. Supporting others doesn't always mean answering questions. Join in celebrating successes! Celebrate your mistakes! Sometimes just hearing that someone else has gone through a similar struggle can be enough to keep a maker moving forward.

The Adafruit Discord is the 24x7x365 hackerspace that you can bring your granddaughter to.

Visit [https://adafru.it/discord](https://adafru.it/discord)to sign up for Discord. Everyone is looking forward to meeting you!

## CircuitPython.org
![](https://cdn-learn.adafruit.com/assets/assets/000/106/064/medium800/WtCP_WttC_circuitpython_org.png?1635809763)

Beyond the Adafruit Learn System, which you are viewing right now, the best place to find information about CircuitPython is [circuitpython.org](https://circuitpython.org). Everything you need to get started with your new microcontroller and beyond is available. You can do things like [download CircuitPython for your microcontroller](https://circuitpython.org/downloads) or [download the latest CircuitPython Library bundle](https://circuitpython.org/libraries), or check out [which single board computers support Blinka](https://circuitpython.org/blinka). You can also get to various other CircuitPython related things like Awesome CircuitPython or the Python for Microcontrollers newsletter. This is all incredibly useful, but it isn't necessarily community related. So why is it included here? The [Contributing page](https://circuitpython.org/contributing).

![](https://cdn-learn.adafruit.com/assets/assets/000/106/067/medium800/circuitpython_WtCP_WttC_contributing.png?1635812628)

CircuitPython itself is written in C. However, all of the Adafruit CircuitPython libraries are written in _Python_. If you're interested in contributing to CircuitPython on the Python side of things, check out [circuitpython.org/contributing](https://circuitpython.org/contributing). You'll find information pertaining to every Adafruit CircuitPython library GitHub repository, giving you the opportunity to join the community by finding a contributing option that works for you.

Note the date on the page next to **Current Status for** :

![](https://cdn-learn.adafruit.com/assets/assets/000/106/082/medium800/circuitpython_WtCP_WttC_contributing_date.png?1635883999)

If you submit any contributions to the libraries, and do not see them reflected on the Contributing page, it could be that the job that checks for new updates hasn't yet run for today. Simply check back tomorrow!

Now, a look at the different options.

### Pull Requests

The first tab you'll find is a list of **open pull requests**.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/065/medium800/circuitpython_WtCP_WttC_open_PRs.png?1635812588)

GitHub pull requests, or PRs, are opened when folks have added something to an Adafruit CircuitPython library GitHub repo, and are asking for Adafruit to add, or merge, their changes into the main library code. For PRs to be merged, they must first be reviewed. Reviewing is a great way to contribute! Take a look at the list of open pull requests, and pick one that interests you. If you have the hardware, you can test code changes. If you don't, you can still check the code updates for syntax. In the case of documentation updates, you can verify the information, or check it for spelling and grammar. Once you've checked out the update, you can leave a comment letting us know that you took a look. Once you've done that for a while, and you're more comfortable with it, you can consider joining the CircuitPythonLibrarians review team. The more reviewers we have, the more authors we can support. Reviewing is a crucial part of an open source ecosystem, CircuitPython included.

### Open Issues

The second tab you'll find is a list of **open issues**.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/066/medium800/circuitpython_WtCP_WttC_open_issues.png?1635812598)

GitHub issues are filed for a number of reasons, including when there is a bug in the library or example code, or when someone wants to make a feature request. Issues are a great way to find an opportunity to contribute directly to the libraries by updating code or documentation. If you're interested in contributing code or documentation, take a look at the open issues and find one that interests you.

If you're not sure where to start, you can search the issues by label. Labels are applied to issues to make the goal easier to identify at a first glance, or to indicate the difficulty level of the issue. Click on the dropdown next to "Sort by issue labels" to see the list of available labels, and click on one to choose it.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/083/medium800/circuitpython_WtCP_WttC_issues_label_list.png?1635884488)

If you're new to everything, new to contributing to open source, or new to contributing to the CircuitPython project, you can choose "Good first issue". Issues with that label are well defined, with a finite scope, and are intended to be easy for someone new to figure out.

If you're looking for something a little more complicated, consider "Bug" or "Enhancement". The Bug label is applied to issues that pertain to problems or failures found in the library. The Enhancement label is applied to feature requests.

Don't let the process intimidate you. If you're new to Git and GitHub, there is [a guide](https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github) to walk you through the entire process. As well, there are always folks available on [Discord](https:adafru.it/discord) to answer questions.

### Library Infrastructure Issues

The third tab you'll find is a list of **library infrastructure issues**.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/084/medium800/circuitpython_WtCP_WttC_library_infrastructure_issues.png?1635885507)

This section is generated by a script that runs checks on the libraries, and then reports back where there may be issues. It is made up of a list of subsections each containing links to the repositories that are experiencing that particular issue. This page is available mostly for internal use, but you may find some opportunities to contribute on this page. If there's an issue listed that sounds like something you could help with, mention it on Discord, or file an issue on GitHub indicating you're working to resolve that issue. Others can reply either way to let you know what the scope of it might be, and help you resolve it if necessary.

### CircuitPython Localization

The fourth tab you'll find is the **CircuitPython Localization** tab.

![](https://cdn-learn.adafruit.com/assets/assets/000/106/085/medium800/circuitpython_WtCP_WttC_weblate.png?1635885684)

If you speak another language, you can help translate CircuitPython! The translations apply to informational and error messages that are within the CircuitPython core. It means that folks who do not speak English have the opportunity to have these messages shown to them in their own language when using CircuitPython. This is incredibly important to provide the best experience possible for all users. CircuitPython uses Weblate to translate, which makes it much simpler to contribute translations. You will still need to know some CircuitPython-specific practices and a few basics about coding strings, but as with any CircuitPython contributions, folks are there to help.

Regardless of your skill level, or how you want to contribute to the CircuitPython project, there is an opportunity available. The [Contributing page](https://circuitpython.org/contributing) is an excellent place to start!

## Adafruit GitHub
![](https://cdn-learn.adafruit.com/assets/assets/000/048/414/medium800/circuitpython_Screen_Shot_2017-11-21_at_18.26.55.png?1511306851)

Whether you're just beginning or are life-long programmer who would like to contribute, there are ways for everyone to be a part of the CircuitPython project. The CircuitPython core is written in C. The libraries are written in Python. GitHub is the best source of ways to contribute to the [CircuitPython core](https://github.com/adafruit/circuitpython), and the [CircuitPython libraries](https://circuitpython.org/contributing/open-issues). If you need an account, visit [https://github.com/](https://github.com/)&nbsp;and sign up.

If you're new to GitHub or programming in general, there are great opportunities for you. For the CircuitPython core, head over to the CircuitPython repository on GitHub, click on "[Issues](https://github.com/adafruit/circuitpython/issues)", and you'll find a list that includes issues labeled "[good first issue](https://github.com/adafruit/circuitpython/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)". For the libraries, head over to the [Contributing page Issues list](https://circuitpython.org/contributing/open-issues), and use the drop down menu to search for "[good first issue](https://circuitpython.org/contributing/open-issues?label=good-first-issue)". These issues are things that have been identified as something that someone with any level of experience can help with. These issues include options like updating documentation, providing feedback, and fixing simple bugs. If you need help getting started with GitHub, there is an excellent guide on [Contributing to CircuitPython with Git and GitHub](https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github).

![](https://cdn-learn.adafruit.com/assets/assets/000/048/163/medium800/circuitpython_Screen_Shot_2017-11-14_at_15.42.01.png?1510692193)

Already experienced and looking for a challenge? Checkout the rest of either issues list and you'll find plenty of ways to contribute. You'll find all sorts of things, from new driver requests, to library bugs, to core module updates. There's plenty of opportunities for everyone at any level!

When working with or using CircuitPython or the CircuitPython libraries, you may find problems. If you find a bug, that's great! The team loves bugs! Posting a detailed issue to GitHub is an invaluable way to contribute to improving CircuitPython. For CircuitPython itself, file an issue [here](https://github.com/adafruit/circuitpython/issues). For the libraries, file an issue on the specific library repository on GitHub. Be sure to include the steps to replicate the issue as well as any other information you think is relevant. The more detail, the better!

Testing new software is easy and incredibly helpful. Simply load the newest version of CircuitPython or a library onto your CircuitPython hardware, and use it. Let us know about any problems you find by posting a new issue to GitHub. Software testing on both stable and unstable releases is a very important part of contributing CircuitPython. The developers can't possibly find all the problems themselves! They need your help to make CircuitPython even better.

On GitHub, you can submit feature requests, provide feedback, report problems and much more. If you have questions, remember that Discord and the Forums are both there for help!

## Adafruit Forums
![](https://cdn-learn.adafruit.com/assets/assets/000/047/713/medium800/circuitpython_AdafruitForumsHeader.png?1509241590)

The [Adafruit Forums](https://forums.adafruit.com) are the perfect place for support. Adafruit has wonderful paid support folks to answer any questions you may have. Whether your hardware is giving you issues or your code doesn't seem to be working, the forums are always there for you to ask. You need an Adafruit account to post to the forums. You can use the same account you use to order from Adafruit.

While Discord may provide you with quicker responses than the forums, the forums are a more reliable source of information. If you want to be certain you're getting an Adafruit-supported answer, the forums are the best place to be.

There are forum categories that cover all kinds of topics, including everything Adafruit. The [Adafruit CircuitPython](https://forums.adafruit.com/viewforum.php?f=60)&nbsp;category under "Supported Products & Projects" is the best place to post your CircuitPython questions.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/611/medium800/circuitpython-forum.png?1640877673)

Be sure to include the steps you took to get to where you are. If it involves wiring, post a picture! If your code is giving you trouble, include your code in your post! These are great ways to make sure that there's enough information to help you with your issue.

You might think you're just getting started, but you definitely know something that someone else doesn't. The great thing about the forums is that you can help others too! Everyone is welcome and encouraged to provide constructive feedback to any of the posted questions. This is an excellent way to contribute to the community and share your knowledge!

## Read the Docs
![](https://cdn-learn.adafruit.com/assets/assets/000/047/897/medium800/circuitpython_Screen_Shot_2017-11-02_at_22.53.06.png?1509677641)

[Read the Docs](https://circuitpython.readthedocs.io/) is a an excellent resource for a more detailed look at the CircuitPython core and the CircuitPython libraries. This is where you'll find things like API documentation and example code. For an in depth look at viewing and understanding Read the Docs, check out the [CircuitPython Documentation](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-documentation) page!

![](https://cdn-learn.adafruit.com/assets/assets/000/106/232/medium800/circuitpython_WtCP_RTD_blinky.png?1636400127)

# Adafruit MEMENTO Camera Board

## microSD Card Formatting Notes

Even though you can/could use your SD card 'raw' - it's most convenient to format the card to a filesystem. For the Arduino library we'll be discussing, and nearly every other SD library, the card must be formatted FAT16 or FAT32. Some only allow one or the other. The Arduino SD library can use either.

If you bought an SD card, chances are it's already pre-formatted with a FAT filesystem. However you may have problems with how the factory formats the card, or if it's an old card it needs to be reformatted. The Arduino SD library we use supports both **FAT16** and **FAT32** filesystems. If you have a very small SD card, say 8-32 Megabytes you might find it is formatted **FAT12** which isn't supported. You'll have to reformat these cards. Either way, it's **always** good idea to format the card before using, even if it's new! Note that formatting will erase the card so save anything you want first.

Info: 

[Download the formatter from https://www.sdcard.org/downloads/formatter/](https://www.sdcard.org/downloads/formatter/)

Download it and run it on your computer, there's also a manual linked from that page for use.

# Adafruit MEMENTO Camera Board

## CircuitPython MEMENTO Starter Projects

Now that you've setup your MEMENTO with CircuitPython, you're ready to get started using the [PyCamera CircuitPython library](https://github.com/adafruit/Adafruit_CircuitPython_PyCamera) for quick camera application development.

Before you load up the example project bundles though, you'll need to create an **/sd** directory on your MEMENTO **CIRCUITPY** drive. As of [CircuitPython 9](https://blog.adafruit.com/2024/01/27/circuitpython-9-0-0-beta-0-released/), this directory needs to be included on your **CIRCUITPY** drive when mounting an SD card. This change was made to allow for accessing the SD cards over web workflow.

To create this **/sd** directory, you'll open the **CIRCUITPY** drive in your operating system's file viewer window.

![adafruit_products_circuitpy_drive0.png](https://cdn-learn.adafruit.com/assets/assets/000/127/358/medium640/adafruit_products_circuitpy_drive0.png?1706643005)

Then, **create a new Folder** on the **CIRCUITPY** drive.

![adafruit_products_rightClick.png](https://cdn-learn.adafruit.com/assets/assets/000/127/359/medium640/adafruit_products_rightClick.png?1706643077)

 **Rename** your new folder " **sd**".

![adafruit_products_renameFolder.gif](https://cdn-learn.adafruit.com/assets/assets/000/127/360/medium640thumb/adafruit_products_renameFolder.jpg?1706643664)

Your **CIRCUITPY** directory will look like this after following these steps. Now you'll be able to mount SD cards with no problems in CircuitPython 9.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/361/medium800/adafruit_products_driveWithSD.png?1706643815)

# Adafruit MEMENTO Camera Board

## MEMENTO Camera Quick Start Guide

# Adafruit MEMENTO Camera Board

## CircuitPython Basic Camera

![](https://cdn-learn.adafruit.com/assets/assets/000/126/831/medium800/adafruit_products_memento-6403.jpg?1703204649)

Ready to take some photos of your favorite goat-based still life\*? Nice. Here you'll code a simple point-and-shoot camera as a way to get familiar with the MEMENTO's basic functions. It'll be just like that Instamatic you had in the 1970s, except digital and programmable!&nbsp;

\* Other subjects are acceptable as well. We don't judge.

### CircuitPython

Be sure you've [installed CircuitPython on your MEMENTO](https://learn.adafruit.com/adafruit-memento-camera-board/install-circuitpython) before proceeding.

## SD Card

Format your SD card to FAT32 using the method shown on the [**Formatting Notes**](https://learn.adafruit.com/adafruit-memento-camera-board/formatting-notes) page in this guide (don't rely on your operating system tools, the official formatter works more reliably).

With the MEMENTO turned off, insert the SD card into the MEMENTO's SD card reader as shown -- note the direction of the pins. Press it in until it bottoms out on the spring and then release pressure so it clicks into place.

![adafruit_products_memento-6399.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/824/medium640/adafruit_products_memento-6399.jpg?1703204240)

![adafruit_products_memento-6400.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/825/medium640/adafruit_products_memento-6400.jpg?1703204250)

![adafruit_products_memento-6401.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/826/medium640/adafruit_products_memento-6401.jpg?1703204257)

![adafruit_products_memento-6402.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/827/medium640/adafruit_products_memento-6402.jpg?1703204265)

Warning: 

Info: 

[Follow these steps to create the /sd directory](https://learn.adafruit.com/adafruit-memento-camera-board/circuitpython-memento-starter-projects)
## 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;button below, and uncompress the .zip file.

Connect your computer to the board via a known good USB power+data cable. A new flash drive should show up as&nbsp; **CIRCUITPY**.

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

https://github.com/adafruit/Adafruit_CircuitPython_PyCamera/blob/main/examples/basic_camera/code.py

Flip the " **-\> On**" switch and you're ready to go!

## Camera HUD

The PyCamera library includes a real-time image preview and heads-up-display (HUD). The HUD provides the following information:

- image pixel resolution
- SD card status
- current effect/filter
- picture mode

![adafruit_products_UI.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/823/medium640/adafruit_products_UI.jpg?1703201816)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/811/medium800/adafruit_products_pic240_ui.jpg?1703200812)

## Take a Photo

To snap a photo, flip the **-\> On** switch to the right if the camera isn't already on, then once the camera has started and you see the preview image and " **SD OK**" simply press and release the shutter button (labeled with " **Cheese!**" or the ✌️ sign if you have the back panel in place). You'll see " **snap**" show on screen and hear a beep.

The image will be saved to the SD card as a high-quality JPEG with a unique filename.

![adafruit_products_memento-6404.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/828/medium640/adafruit_products_memento-6404.jpg?1703204426)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/830/medium800/adafruit_products_memento-6405.jpg?1703204577)

## Image Retrieval

To admire your photo and send it to other goat fanciers, press and release the microSD card to pop it out of the camera. Be careful not to fling it across the room, that spring is pretty springy.

Put your microSD card into an SD card reader on your computer and open up the image (you may need a microSD to SD adapter such as [this](https://www.adafruit.com/product/5447)). You can copy/paste or drag the images onto your computer's hard drive, too. Be sure to eject the microSD card drive from your computer before physically removing it.

Here you can see an 800x600 resolution image (the thumbnail of the preview and HUD won't be there, those were added for clarity in this guide).

![](https://cdn-learn.adafruit.com/assets/assets/000/126/813/medium800/adafruit_products_pic800.jpg?1703200864)

## Change Resolution

In code you can adjust the resolution by setting a different value for `pycam.resolution`.

```auto
pycam.resolution = 0
# 0-12 preset resolutions:
# 0: 240x240, 1: 320x240, 2: 640x480, 3: 800x600, 4: 1024x768,
# 5: 1280x720, 6: 1280x1024, 7: 1600x1200, 8: 1920x1080, 9: 2048x1536,
# 10: 2560x1440, 11: 2560x1600, 12: 2560x1920
```

Here's the `0` setting, which is a 240x240 image.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/812/medium800/adafruit_products_pic240.jpg?1703200839)

This is the 1920x1080 option, click the image for the option to see the original at full size.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/814/medium800/adafruit_products_pic1920.jpg?1703200881)

This is the 2560x1920 option, click the image for the option to see the original at full size.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/815/medium800/adafruit_products_pic2560.jpg?1703200895)

## Effects

There are some built-in effects/filters you can try by adjusting the `pycam.effect` value.

```auto
pycam.effect = 0  # 0-7 preset FX: 0: normal, 1: invert, 2: b&amp;w, 3: red,
# 4: green, 5: blue, 6: sepia, 7: solarize
```

![](https://cdn-learn.adafruit.com/assets/assets/000/126/816/medium800/adafruit_products_pic800_invert.jpg?1703201008)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/817/medium800/adafruit_products_pic800_BW.jpg?1703201023)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/818/medium800/adafruit_products_pic800_reddish.jpg?1703201033)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/819/medium800/adafruit_products_pic800_greenish.jpg?1703201041)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/820/medium800/adafruit_products_pic800_blueish.jpg?1703201059)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/821/medium800/adafruit_products_pic800_sepia.jpg?1703201069)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/822/medium800/adafruit_products_pic800_solarize.jpg?1703201084)

## LED Color

If you have the LED light ring faceplate connected, you can set LED brightness and color values using `pycam.led_level `and` pycam.led_color`.

```auto
pycam.led_level = 1  # 0-4 preset brightness levels
pycam.led_color = 0  # 0-7  preset colors: 0: white, 1: green, 2: yellow, 3: red,
# 4: pink, 5: blue, 6: teal, 7: rainbow
```

Here are some examples of colored lighting on the scene. There is a lot of ambient light here, so the color is reasonably subtle. With less ambient light the color will be more intense.

![adafruit_products_grnimg0061.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/832/medium640/adafruit_products_grnimg0061.jpg?1703205719)

![adafruit_products_redimg0063.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/833/medium640/adafruit_products_redimg0063.jpg?1703205725)

![adafruit_products_blueimg0065.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/834/medium640/adafruit_products_blueimg0065.jpg?1703205745)

## More Camera!

Want to see an example with even more features? Check out the example on the next page!

# Adafruit MEMENTO Camera Board

## Fancy Camera

This example from the Adafruit CircuitPython PyCamera library is similar to the Basic Camera, but adds **autofocus** and on-camera user interaction via the MEMENTO's buttons to give you more of a point-and-shoot camera experience.

You can use the buttons to adjust:

- **resolutions**
- **effects**
- **modes**
- **optional NeoPixel LED colors**

Format your SD card if necessary and insert it in the MEMENTO SD card reader as shown on the [Basic Camera page](https://learn.adafruit.com/adafruit-memento-camera-board/basic-camera).

### CircuitPython

Be sure you've [installed CircuitPython on your MEMENTO](https://learn.adafruit.com/adafruit-memento-camera-board/install-circuitpython) before proceeding.

## 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;button below, and uncompress the .zip file.

Connect your computer to the board via a known good USB power+data cable. A new flash drive should show up as&nbsp; **CIRCUITPY**.

Drag the contents of the uncompressed bundle directory for the version of CircuitPython you're running (e.g., **/examples/camera/CircuitPython 9.x/** ) onto your board's **CIRCUITPY** &nbsp;drive, replacing any existing files or directories with the same names, and adding any new ones that are necessary.

![adafruit_products_Screenshot_2024-02-26_at_8.10.59_AM.jpg](https://cdn-learn.adafruit.com/assets/assets/000/128/015/medium640/adafruit_products_Screenshot_2024-02-26_at_8.10.59_AM.jpg?1708963901)

https://github.com/adafruit/Adafruit_CircuitPython_PyCamera/blob/main/examples/camera/code.py

## Use the Camera

Taking pictures is just as simple as with the Basic Camera -- you could say it's a snap -- simply follow these two steps:

1. point the MEMENTO at a subject while framing it in the display
2. press-and-release the shutter button fairly quickly

### Autofocus

However, now you can use the autofocus feature to help keep closer subjects looking sharp:

1. point the MEMENTO at a subject while framing it in the display
2. press-and-hold the shutter button until you hear the beep (you should also see the focus change if there is a close subject in frame)
3. release the shutter button to finish enabling autofocus
4. press-and-release the shutter button to snap your pic!

I ate the banana. So now we have a can of Liquid Wrench to take its place. Which is great, because it is still yellow, but has a lot more detail on which to focus!

In the first photo, the MEMENTO's default distant focus is shown. Note how the Droid Builders patch is in focus but the mid and foreground objects aren't.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/874/medium800/adafruit_products_default_focus.jpg?1704415920 Default infinite focus)

For this second shot I pointed the camera at the can of Liquid Wrench, held the shutter button to set the MEMENTO's autofocus, released it, then aimed it back at the patch and snapped the pic. Such nice close-up focus!

![](https://cdn-learn.adafruit.com/assets/assets/000/126/875/medium800/adafruit_products_autofocus.jpg?1704416127 Autofocus on near subject)

## Settings

While the Basic Camera example settings could only be changed directly in code, in the Fancy Camera example you can use the MEMENTO's four directional buttons to change settings on the fly.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/877/medium800/adafruit_products_mem_buttns.jpg?1704419726)

- press **Right** button to pick a menu category **Resolution** , **Effect** , or **Mode**
- the category will be highlighted
- press **Up** or **Down** buttons to select the choices within the mode:
  - **Resolution** will page through the different available resolutions
  - **Effect** picks the different effects, such as **Normal** , **Invert** , **B&W** , **Reddish** , **Sepia** , **Solarize** , etc.
  - **Mode** will flip between **JPEG** , **GIF** , **GBOY, STOP** , **LAPS (we'll cover stop motion mode and timelapse modes elsewhere in this guide)**

![](https://cdn-learn.adafruit.com/assets/assets/000/126/879/medium800thumb/adafruit_products_fancycamUI2.jpg?1704431286)

# Adafruit MEMENTO Camera Board

## Timelapse

![](https://cdn-learn.adafruit.com/assets/assets/000/127/394/medium800thumb/adafruit_products_skylapse2.jpg?1706732857)

https://youtu.be/MJhWNFc-VeA

A sprout growing quickly from the soil. Clouds racing across the sky. A building constructed from scratch in a matter of minutes. Jigsaw puzzles coming together in moments. These are some of the things you can do with timelapse photography. All you need is a camera and an intervalometer. Luckily for us, the MEMENTO can be both!

The camera part is straightforward, but what about this so-called "intervalometer"? That's a fancy term for a gizmo that can press the shutter for you (hardware or software) at a pre-set interval until you tell it to stop. It never gets tired, so you can set it to shoot once per second or per hour or even just once per day, to capture a long event.

Then, you'll play back those individual still frames rapidly as a movie or GIF. Time flies when you're having fun!

### CircuitPython

Be sure you've [installed CircuitPython on your MEMENTO](https://learn.adafruit.com/adafruit-memento-camera-board/install-circuitpython) before proceeding.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/376/medium800/adafruit_products_laps10.jpg?1706724718)

## LAPS

No, we won't be hitting the track -- we just abbreviated "timelapse" to "LAPS" in the menu system.

To switch to&nbsp; **timelapse** mode, you'll use the right or left button to get to the&nbsp; **mode** &nbsp;menu, then press up or down to switch to the&nbsp; **LAPS** &nbsp;selection.

### Intervals

You'll see a new menu set show up for adjusting the timelapse settings. Press the **right** button until the timelapse interval item is highlighted. You can then press up or down to increase or decrease the preset intervals, from **5 seconds** up to an hour between shots.

![adafruit_products_laps4.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/380/medium640/adafruit_products_laps4.jpg?1706725032)

![adafruit_products_laps5.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/381/medium640/adafruit_products_laps5.jpg?1706725054)

### Power

Press the **Select** button to choose the High, Medium, or Low power timelapse modes. These are helpful if you are running off of the MEMENTO battery --

- high power mode shows a live preview
- medium power mode only updates the display once per shot based on the selected time interval
- low power mode dims the display as well as limiting updates to once per shot

![adafruit_products_laps1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/377/medium640/adafruit_products_laps1.jpg?1706724771)

![adafruit_products_laps2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/378/medium640/adafruit_products_laps2.jpg?1706724803)

![adafruit_products_laps3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/379/medium640/adafruit_products_laps3.jpg?1706724830)

Primary: 

## Focus

You may wish to long-press the shutter button to focus on your subject when shooting a timelapse. All of the other automatic camera settings, such as exposure/gain, will lock onto their first frame settings, to prevent flickering in the final timelapse movie you'll create from your frames.

https://youtu.be/ngUn2oi3fxo

## Start/Stop

Once you've got your settings dialed in, point the MEMENTO at your subject (a tripod case or other mounting is helpful to prevent accidental bumps) and then press the MEMENTO **OK** button.&nbsp;

The on-screen display will show a countdown timer and then snap a photo. This repeats until you press **OK** again to stop it (or until you run out of SD card space or battery!) So you can capture the clouds moving across the sky all day long, or an hour long house-of-cards building session, it's up to you!

After shooting your frames, bring the files into your computer and convert them into an animation using your favorite editing software, such as Photoshop, or a GIF creation web page. [This page](https://learn.adafruit.com/adafruit-memento-camera-board/frames-to-gifs) shows you how to do this step-by-step using ezgif.com/maker

![](https://cdn-learn.adafruit.com/assets/assets/000/127/382/medium800thumb/adafruit_products_uitimelapsegif.jpg?1706726529)

# Adafruit MEMENTO Camera Board

## Animated GIF Creation

![](https://cdn-learn.adafruit.com/assets/assets/000/126/963/medium800thumb/adafruit_products_img0014.jpg?1704855379)

You can create short animated GIFs with the MEMENTO, perfect for sharing in text chats!

The Fancy Camera example will record a 15 frame, 240x176 pixel GIF\* of about two seconds in duration each time you press and release the shutter button.

### CircuitPython

Be sure you've [installed CircuitPython on your MEMENTO](https://learn.adafruit.com/adafruit-memento-camera-board/install-circuitpython) before proceeding.

## GIF Mode

To enter **GIF** mode, press the right button three times, you'll see the mode text highlight. By default it will be in **JPEG** mode.

Press the up button to cycle modes and choose **GIF** mode.

Warning: 

### Make a GIF

Now, simply press and release the shutter button to record a two-second GIF animation. The GIF is saved automatically to the SD card. There is no on-camera preview, so you'll need to put the SD card in your computer's SD card reader to view it.

## GIF Code

Here's the code snippet from the Fancy Camera code used for GIF creation -- you can use this to incorporate GIF recording into your own custom code:

```auto
if pycam.mode_text == "GIF":
            try:
                f = pycam.open_next_image("gif")
            except RuntimeError as e:
                pycam.display_message("Error\nNo SD Card", color=0xFF0000)
                time.sleep(0.5)
                continue
            i = 0
            ft = []
            pycam._mode_label.text = "RECORDING"  # pylint: disable=protected-access

            pycam.display.refresh()
            with gifio.GifWriter(
                f,
                pycam.camera.width,
                pycam.camera.height,
                displayio.Colorspace.RGB565_SWAPPED,
                dither=True,
            ) as g:
                t00 = t0 = time.monotonic()
                while (i &lt; 15) or not pycam.shutter_button.value:
                    i += 1
                    _gifframe = pycam.continuous_capture()
                    g.add_frame(_gifframe, 0.12)
                    pycam.blit(_gifframe)
                    t1 = time.monotonic()
                    ft.append(1 / (t1 - t0))
                    print(end=".")
                    t0 = t1
            pycam._mode_label.text = "GIF"  # pylint: disable=protected-access
            print(f"\nfinal size {f.tell()} for {i} frames")
            print(f"average framerate {i/(t1-t00)}fps")
            print(f"best {max(ft)} worst {min(ft)} std. deviation {np.std(ft)}")
            f.close()
            pycam.display.refresh()
```

## Effects

The default GIF is created without effects applied, but you can get creative by picking built-in effects before shooting a GIF.

Press the right button to highlight the effect menu item, by default it is the **Normal** effect. Press up/down to cycle between the effects:

- Invert
- B&W
- Reddish
- Greenish
- Blueish
- Sepia
- Solarize

Then, shoot your GIF by pressing the shutter button as usual. Here are some examples:

![](https://cdn-learn.adafruit.com/assets/assets/000/126/962/medium800thumb/adafruit_products_img0000_3.jpg?1704855366 solarize effect)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/964/medium800thumb/adafruit_products_img0001_3.jpg?1704855391 invert effect)

## NeoPixel Lighting

You can also add some NeoPixel lighting to your GIFs if you have the MEMENTO Camera Enclosure kit attached and connected over the JST cable.

Press the right button until **LED LV** is highlighted, then press up to pick a pre-set lighting level.

Press the right button again to highlight **LED CLR** , then press the up button so pick a pre-set color.

Here's an example of a weird guy with some magenta lighting highlights that look particularly odd inside his mouth. Freaky.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/961/medium800thumb/adafruit_products_img0000.jpg?1704855357 weird guy, colored lighting)

## Post Processing

You can also use GIF editing tools (online or applications) to further edit your GIFs. Here's an example of creating a looping version of the basketball animation by doubling and re-ordering the frames:

![](https://cdn-learn.adafruit.com/assets/assets/000/126/965/medium800thumb/adafruit_products_img0014_loop.jpg?1704910763)

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

\* Pronounced&nbsp; **_GHIF_** as in. _" **G** ood **g** rief, **g** ive me a break, **g** o **g** et some peanut butter for your **g** raphics if you wanna say 'JIF'."_

Don't @ me bro.

# Adafruit MEMENTO Camera Board

## Stop Motion

You can use the MEMENTO to create simple stop motion animations. By taking a series of still pictures and stitching them together, you can create an animation!

### Persistence of Vision

The key principal to understand for any kind of animation, including stop motion, is persistence of vision. Our brains are very good at filling in the blanks and imagining continuous motion when we see a series of still images displayed in quick succession.

This is how motion pictures work, as well as mechanical illusions, such as zoetropes and flipbooks. Traditional animation methods such as hand drawn animation, and puppet- or clay-based stop motion animation work the same way. Create a single frame by drawing a pose, or posing a figure, and then shoot a frame of the image onto film, or, more likely these days, a digital photograph. Then, create a new pose, shoot a second frame, and repeat this on and on.

When you then rapidly review those images you photographed, suddenly your subject starts moving and comes to life!

For more in-depth info on creating stop motion animation, [check out this guide](https://learn.adafruit.com/stop-motion-animation/overview).

![adafruit_products_stickypose.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/126/968/medium640/adafruit_products_stickypose.jpeg?1704918359)

### CircuitPython

Be sure you've [installed CircuitPython on your MEMENTO](https://learn.adafruit.com/adafruit-memento-camera-board/install-circuitpython) before proceeding.

## Onion Skinning

One feature of the MEMENTO camera that's helpful for stop motion is the onion skinning, a.k.a. ghosting feature. This is an overlay you'll see on the screen of your previously shot frame while you're composing your current frame. It lets you see where your character was so you can gauge how far to move it.

In the Fancy Camera application on the MEMENTO, press the right button to highlight the mode item and then press up to change from **JPEG, GIF,** or **GBOY** to **STOP** mode.

At first the viewer will appear as usual, but after you shoot one frame you'll then see a semi-transparent overlay of the previously saved image on top of the live view.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/966/medium800/adafruit_products_skin1.jpg?1704915404)

## Wave

Try creating a hand waving animation with a mannequin or other figure. You can try moving straight ahead with the poses, referencing the previous pose overlay to see where you were.

You can take multiple photos at one pose to hold the pose and to slow down the action.

After shooting your frames, bring the files into your computer and convert them into an animation using your favorite editing software, such as Photoshop, or a GIF creation web page. [This page](https://learn.adafruit.com/adafruit-memento-camera-board/frames-to-gifs) shows you how to do this step-by-step using ezgif.com/maker

![](https://cdn-learn.adafruit.com/assets/assets/000/126/967/medium800thumb/adafruit_products_wave1.jpg?1704918185)

# Adafruit MEMENTO Camera Board

## Frames to GIFs

When you shoot stop motion frames or timelapse sessions you'll end up with a sequence of .jpg images on your SD card. That's rad and all, but how do you stitch them into a single GIF animation so everyone can enjoy them easily when you share them in text messages or on social media?

![adafruit_products_skythumbz.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/414/medium640/adafruit_products_skythumbz.jpg?1706751901)

One simple way is to use [ezgif.com](https://ezgif.com/maker)&nbsp;It allows you to upload a sequence of images, adjust things like timing, crop, and size, and then convert them into a single animated GIF you can download.

## GIF Maker

Go to [https://ezgif.com/maker](https://ezgif.com/maker) in your web browser.

Click on the Choose Files button to open your file browser.

![adafruit_products_gifmake0.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/395/medium640/adafruit_products_gifmake0.jpg?1706734608)

## Select Files

Use your file browser to select the sequence of .jpg frames on your MEMENTO SD card that you've put in your computer's SD card reader, then click **Open&nbsp;** in the file browser window.

You can hover over the Choose Files button to see the list of images.

![adafruit_products_gifmake2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/398/medium640/adafruit_products_gifmake2.jpg?1706734874)

![adafruit_products_gifmake3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/399/medium640/adafruit_products_gifmake3.jpg?1706735023)

Primary: 

[skylapse.zip](https://cdn-learn.adafruit.com/assets/assets/000/127/422/original/skylapse.zip?1706736810)
## Upload Files

Click the **Upload files** button to upload the image sequence to the ezgif server in the sky. The button will gray out and display " **Uploading files**" while it is transferring images.

![adafruit_products_gifmake1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/396/medium640/adafruit_products_gifmake1.jpg?1706734723)

![adafruit_products_gifmake4.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/400/medium640/adafruit_products_gifmake4.jpg?1706735139)

## Frame Order, Delay

Once your frames have been uploaded the thumbnail view will appear. Here you can re-order frames by drag-dropping them, adjust delay timing, skip, and copy frames.

![adafruit_products_gifmake5.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/402/medium640/adafruit_products_gifmake5.jpg?1706735233)

## Make a GIF

When you're ready to have the GIF created, click the **Make a GIF** button.

![adafruit_products_gifmake6.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/403/medium640/adafruit_products_gifmake6.jpg?1706735324)

## Save Your GIF

Once the GIF is ready it will play back for you in the browser window to review. You can make changes at this point, just check out the icons at the bottom, they're very cool and pretty self-explanatory.

When you want to download your GIF, click the **save** button with the floppy disc icon. This will download to your system/browser default download location.

![adafruit_products_gifmake7.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/404/medium640/adafruit_products_gifmake7.jpg?1706735409)

![](https://cdn-learn.adafruit.com/assets/assets/000/127/411/medium800thumb/adafruit_products_skylapse2.jpg?1706751555)

# Adafruit MEMENTO Camera Board

## Arduino IDE Setup

Warning: 

### Install Arduino IDE

The first thing you will need to do is to download the latest release of the Arduino IDE. You will need to&nbsp;be using&nbsp; **version 1.8** &nbsp;or higher for this guide.

[Arduino IDE Download](http://www.arduino.cc/en/Main/Software)
### Install ESP32 Board Support Package from GitHub

For this board, we recommend you _don't_ use 'release' version of Espressif's board support package because the current release doesn't include board support.

Instead we will install the "very latest" [by following these instructions](https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#windows-manual-installation) (scroll down for Mac and Linux as well

Basically, install by **git clone** -ing the Espressif ESP32 board support to get the very latest version of the code.

In the **Tools → Board** submenu you should see **ESP32 Arduino (in sketchbook)** and in that dropdown it should contain the ESP32 boards along with all the latest ESP32 boards.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/605/medium800/esp32_arduino_ide_setup_image.png?1646944312)

Look for the board called Adafruit pyCamera S3.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/756/medium800/adafruit_products_boardSketchbook.png?1702994121)

The upload speed can be changed: faster speed makes uploads take less time but sometimes can cause upload issues. **921600** should work fine, but if you're having issues, you can drop down lower.

# Adafruit MEMENTO Camera Board

## Arduino MEMENTO Library Installation and Starter Projects

Using the MEMENTO with Arduino involves installing the [Adafruit\_PyCamera](https://github.com/adafruit/Adafruit_PyCamera) library and running the provided example code.

## Library Installation

You can install the **Adafruit\_PyCamera** library using the Library Manager in the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/789/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1703108094)

Click the **Manage Libraries ...** menu item, search for **Adafruit\_PyCamera** , and select the **Adafruit PyCamera**  **Library** :

![](https://cdn-learn.adafruit.com/assets/assets/000/126/790/medium800/adafruit_products_ard_lib.png?1703108273)

If asked about dependencies, click "Install all".

![](https://cdn-learn.adafruit.com/assets/assets/000/126/791/medium800/adafruit_products_depends.png?1703108300)

If the "Dependencies" window does not come up, then you already have the dependencies installed.

Warning: 

The following examples will use this library to access all of the hardware features on the MEMENTO.

# Adafruit MEMENTO Camera Board

## PyCamera Library Test

This example is included in the Adafruit PyCamera Arduino library. It is the fully featured Factory Demo that ships on the MEMENTO board. You can either drag and drop the example UF2 file to the MEMENTO or compile and upload the code with the Arduino IDE.

[memento_factory_test.ino.uf2](https://cdn-learn.adafruit.com/assets/assets/000/126/810/original/memento_factory_test.ino.uf2?1703194246)
## Factory Demo Code
https://github.com/adafruit/Adafruit_PyCamera/blob/main/examples/memento_factory_test/memento_factory_test.ino

Warning: 

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. On the MEMENTO display, you'll see a preview of what the camera module is seeing. You'll be able to change the resolution and filter for the camera. If you insert a microSD card, you'll be able to take pictures using the **BOOT** button.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/808/medium800thumb/adafruit_products_5420-04.jpg?1703190811)

# Adafruit MEMENTO Camera Board

## Basic Camera Example

This example is a basic camera script for the MEMENTO. With it you can insert a microSD card and take a photo at 800x640 resolution by pressing the **BOOT** button. You can either drag and drop the example UF2 file to the MEMENTO or compile and upload the code with the Arduino IDE.

[espressif.esp32.adafruit_camera_esp32s3-Arduino_Basic_Camera.ino.uf2](https://cdn-learn.adafruit.com/assets/assets/000/126/842/original/espressif.esp32.adafruit_camera_esp32s3-Arduino_Basic_Camera.ino.uf2?1703348158)
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/MEMENTO/Arduino_Basic_Camera/Arduino_Basic_Camera.ino

Warning: 

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. On the MEMENTO display, you'll see a preview of what the camera module is seeing. If you insert a microSD card, you'll be able to take pictures using the **BOOT** button. This is a basic example that you can build on with your own code.

# Adafruit MEMENTO Camera Board

## Usage with PlatformIO

Warning: 

The PyCamera Arduino library brings in a _considerable_ _number_ of dependencies and takes a _looong_ time to compile using Arduino IDE.

If you're working on an advanced MEMENTO project that requires additional dependencies, such as a component from the ESP-IDF component registry, you'll want to compile the PyCamera Arduino project using PlatformIO rather than Arduino IDE.

_How fast is it?_ Very! Using PlatformIO compiles the PyCamera Library Test example in ~4.10 seconds.

## Installation

Follow this page's instructions to install PlatformIO and Visual Studio Code (the IDE of choice for using PlatformIO).

[Download PlatformIO](https://platformio.org/install/ide?install=vscode)
The ZIP file below includes a pre-configured workspace for using PlatformIO. **Download and unzip this file**. Then, save it somewhere safe, like your desktop.

[memento_platformio.zip](https://cdn-learn.adafruit.com/assets/assets/000/127/077/original/memento_platformio.zip?1705435502)
Open Visual Studio Code (VSCode). To ensure you have installed the PlatformIO extension properly, **look for the alien symbol in your VSCode sidebar.**

![](https://cdn-learn.adafruit.com/assets/assets/000/127/074/medium800/adafruit_products_vscode.png?1705427430)

Underneath Start, **click _Open..._**

![](https://cdn-learn.adafruit.com/assets/assets/000/127/075/medium800/adafruit_products_open.png?1705427509)

 **Navigate to the folder created when you unzipped the zip file. Then, Click Open** to open the workspace.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/076/medium800/adafruit_products_Cursor_and_platformio_ini_%E2%80%94_memento_platformio_2.png?1705435095)

A large amount of configuration files and directories will appear in your VSCode instance.

To compile this code, we are only going to discuss the following files and directories:

- `platformio.ini` - This is the project configuration file used to build the demo code. More [documentation about this file is located here](https://docs.platformio.org/en/latest/projectconf/index.html).
- `lib` directory - This directory is intended for project-specific (private) libraries. PlatformIO will compile them to static libraries and link them into executable files. 
  - For our project, the specific library within this directory is the [Adafruit\_PyCamera](https://github.com/adafruit/Adafruit_PyCamera/) library.&nbsp;

- `src` directory - The directory where the source code of the project is located, `main.cpp`. When code in PlatformIO is built or uploaded, files from this directory are used.

## PyCamera Library Test

Before the code is compiled, you'll need to make two changes to the platformio.ini file:

- Change `upload_port` to reflect the MEMENTO's upload port.&nbsp;
  - Don't know the desired port? We have steps to find them for [Windows](https://learn.adafruit.com/adafruit-memento-camera-board/advanced-serial-console-on-windows#whats-the-com-2977217), [MacOS](https://learn.adafruit.com/adafruit-memento-camera-board/advanced-serial-console-on-mac-and-linux#whats-the-port-2977243), and [Linux](https://learn.adafruit.com/adafruit-memento-camera-board/advanced-serial-console-on-linux).

- The `monitor_port` is different from the `upload_port`, and will only appear on your computer when you've uploaded the test code. For now, leave this alone.
  - After uploading the test code, change `monitor_port`&nbsp;to reflect the MEMENTO's monitor/serial port.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/078/medium800/adafruit_products_pio_ini.png?1705437310)

Navigate to `src/main.cpp` to open the example code.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/079/medium800/adafruit_products_maincpp.png?1705437432)

With this file open, **click the Alien symbol on the VSCode sidebar** to open the PlatformIO Project Explorer.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/080/medium800/adafruit_products_click.png?1705437498)

Underneath PlatformIO's Project Tasks, click **Build**.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/127/081/medium800/adafruit_products_build_click.png?1705437554)

Once the build task is completed, the terminal will show `SUCCESS` along with the time it took to compile the project.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/082/medium800/adafruit_products_success.png?1705437770)

Before uploading this project to the board, [put the board into ROM Bootloader Mode](https://learn.adafruit.com/adafruit-memento-camera-board/factory-reset?preview_token=4voYBMZdO8AtkFcVdydTUA#step-2-enter-rom-bootloader-mode-3106832).&nbsp;

From the PlatformIO Project Tasks menu, click **Upload**.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/083/medium800/adafruit_products_upload_click.png?1705437928)

Once the upload completes, the terminal should look like the following screenshot and show `SUCCESS`.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/086/medium800/adafruit_products_upload_complete.png?1705438202)

Press the RST (Reset) button on the MEMENTO to run the uploaded code.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/085/medium800/adafruit_products_rst.png?1705438173)

After the board resets, you'll see a preview of what the camera module is seeing on the MEMENTO display. You'll be able to change the resolution and filter for the camera. If you insert a microSD card, you'll be able to take pictures using the BOOT button.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/084/medium800thumb/adafruit_products_5420-04.jpg?1705438128)

# Adafruit MEMENTO Camera Board

## Factory Reset

The MEMENTO board ships running a PyCamera demo. It's lovely, but you probably had other plans for the board. As you start working with your board, you may want to return to the original code to begin again, or you may find your board gets into a bad state. Either way, this page has you covered.

You're probably used to seeing the **CAMERABOOT** drive when loading CircuitPython or Arduino. The **CAMERABOOT** drive is part of the UF2 bootloader, and allows you to drag and drop files, such as CircuitPython. However, on the ESP32-S3 the UF2 bootloader can become damaged.

# Install the Factory Reset Firmware UF2
If you have a bootloader still installed - which means you can double-click to get the **CAMERABOOT** drive to appear, then you can simply drag this UF2 file over to the **CAMERABOOT** drive.

To enter UF2 bootloader mode, plug in the board into a USB cable with data/sync capability. Press the reset button once, wait till the RGB LED turns purple, then quickly press the reset button again. (You are doing a "slow double-click"). Then drag this file over:

[Adafruit MEMENTO Factory Reset UF2](https://github.com/adafruit/Adafruit-MEMENTO-PCB/raw/main/factory-reset/Adafruit_MEMENTO_Factory_Reset.uf2)
Your board is now back to its factory-shipped state, running again with the original factory program. You can now begin again with your plans for your board.

Info: Re-loading the factory reset UF2 isn't necessary to start over with the board, but it's a good way to show the board is working.

# UF2 Bootloader Installation and Repair
What if you tried double-tapping the reset button, and you still can't get into the UF2 bootloader? Whether your board shipped without the UF2 bootloader, or something damaged it, this section has you covered.

Warning: There is no protection for the UF2 bootloader. That means it is possible to erase or damage the UF2 bootloader, especially if you upload an Arduino sketch to an ESP32-S2/S3 board that doesn't "know" there's a bootloader it should not overwrite!

It turns out, however, the ESP32-S2/S3 comes with a second, built-in, bootloader, the ROM bootloader, which cannot be erased or damaged. You can always reload the UF2 bootloader using&nbsp;the ROM bootloader.

There are three ways to do a factory reset and bootloader repair. The first and easiest is to [use the **OPEN INSTALLER** button](https://learn.adafruit.com/using-open-installer-on-circuitpython-org) on the page for your board on [circuitpython.org](https://circuitpython.org). This method requires no manual downloads and guides you through the steps interactively. **We highly recommend this method as your first choice.**

The second method is to use&nbsp;the browser-based **Adafruit WebSerial ESPTool** , and the third is to use `esptool.py` via the command line.&nbsp;

For both OPEN INSTALLER and the Adafruit WebSerial tool, you must use a Chromium-based browser such as Chrome, Edge, Opera, or Chromium.

Danger: Installing the UF2 bootloader will erase everything on your board, including CircuitPython, any Arduino program, and any files stored in flash! Be sure to back up your data first.

## OPEN INSTALLER Method for UF2 Bootloader Installation
The OPEN INSTALLER button on&nbsp;[circuitpython.org](https://circuitpython.org/) is the easiest way to install or update the UF2 bootloader. See the Learn Guide [Using the OPEN INSTALLER Button on circuitpython.org](https://learn.adafruit.com/using-open-installer-on-circuitpython-org) for all the details.

![This image shows OPEN INSTALLER button for firmware installation available on some boards on circuitpython.org.](https://cdn-learn.adafruit.com/assets/assets/000/140/085/medium640/esp32_s2_s3_factory_reset_open-installer-hero.png?1759343276)

## Adafruit WebSerial ESPTool and `esptool.py` Methods for UF2 Bootloader Installation

The other methods for bootloader installation require you to download the bootloader yourself. The next section walks you through the prerequisite steps needed for both of these methods.

## Step 1. Download the UF2 Bootloader&nbsp; **.bin** File for your board
Clik on the green button below to download the **.bin** file you need (there may be more than one listed), and save wherever is convenient for you. You will need to be able to access the file from the Adafruit WebSerial ESPTool or another upload method.

Primary: Note that this file is approximately 3MB. This is not because the bootloader is that large, but because the bootloader needs to write data at both the beginning and end of flash. Most of the file is empty.

[MEMENTO bootloader 0.33.0 combined-ota.bin](https://adafruit-circuit-python.s3.amazonaws.com/bootloaders/esp32/adafruit_camera_esp32s3/tinyuf2-adafruit_camera_esp32s3-0.33.0-combined-ota.bin)
## Step 2. Enter ROM bootloader mode

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

**Before you start, make sure your ESP32-S2/S3 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** - check that you see the green power light on so you know the board is powered, a prerequisite!

To enter the bootloader:

1. **Press and hold the BOOT/DFU button down.** &nbsp;Don't let go of it yet!
2. **Press and release the Reset button.** &nbsp;You should still have the BOOT/DFU button pressed while you do this.
3. **Now you can release the BOOT/DFU button.**

![](https://cdn-learn.adafruit.com/assets/assets/000/126/754/medium800/adafruit_products_bootReset.jpg?1702946585)

No USB drive will appear when you've entered the ROM bootloader. This is normal!

Now that you've downloaded the **.bin** file and entered the ROM bootloader, you're ready to continue installing the UF2 bootloader. The next two sections walk you through using the Adafruit WebSerial ESPTool (Alternative A) or&nbsp;`esptool.py`&nbsp;(Alternative B).

(There is also an Alternative C below, using the Arduino IDE, but it is less desirable, because it does not allow you to choose the bootloader that will be used.)

## Step 3: Alternative A. The Adafruit WebSerial ESPTool Method
Primary: We highly recommend using the Adafruit  WebSerial ESPTool method to perform a factory reset and bootloader repair. However, if you'd rather use **esptool.py** via the command line, you can skip this section and use Alternative B instead.

This method uses the Adafruit WebSerial ESPTool through Chrome or a Chromium-based browser (including Opera and Edge). Adafruit WebSerial ESPTool is a web-based option for programming ESP32-S2/S3 boards. It allows you to erase the the microcontroller flash and program up to four files at different offsets.

You have to use a Chromium-based browser (Chrome, Opera, Edge, etc.) for this to work. Safari and Firefox are _not_ supported because they don't have adequate support for Web Serial functionality.

Follow the steps below to flash the UF2 bootloader.

Warning: 

## Connect

You should have plugged in **only the ESP32-S2/S3 that you intend to flash**. That way there's no confusion in picking the proper port when it's time!

In the **Chrome browser** visit [https://adafruit.github.io/Adafruit\_WebSerial\_ESPTool/](https://adafruit.github.io/Adafruit_WebSerial_ESPTool/). You should see something like the image shown.

Leave the **No reset for Passthrough updates** toggle **off**.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/135/medium640/esp32_s2_s3_factory_reset_adafruit.github.io_Adafruit_WebSerial_ESPTool_.png?1751474093)

Press the&nbsp; **Connect** &nbsp;button in the top right of the web browser. You will get a pop up asking you to select the COM or Serial port.

**Remember, you should remove all other USB devices so**  **_only_ the ESP32-S2/S3 board is attached, that way there's no confusion over multiple ports!**

On some systems, such as MacOS, there may be additional system ports that appear in the list.

![factory_reset___esp32_s2_s3_Select_Device.png](https://cdn-learn.adafruit.com/assets/assets/000/116/446/medium640/factory_reset___esp32_s2_s3_Select_Device.png?1667580185)

The JavaScript code will now try to connect to the ROM bootloader. It may timeout for a bit until it succeeds. On success, you will see that it is **Connected** and will print out a unique **MAC address** identifying the board along with other information that was detected.

![factory_reset___esp32_s2_Screen_Shot_2022-04-04_at_3.16.00_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/503/medium640/factory_reset___esp32_s2_Screen_Shot_2022-04-04_at_3.16.00_PM.png?1649111586)

&nbsp;

&nbsp;

Once you have successfully connected, the command toolbar will appear.

![factory_reset___esp32_s2_s3_Connected.png](https://cdn-learn.adafruit.com/assets/assets/000/116/447/medium640/factory_reset___esp32_s2_s3_Connected.png?1667580336)

## Erase the Contents of Flash
Warning: 

To erase the contents, click the Erase button. You will be prompted whether you want to continue. Click OK to continue or if you changed your mind, just click cancel.

![factory_reset___esp32_s2_s3_Erase.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/448/medium640/factory_reset___esp32_s2_s3_Erase.jpg?1667580381)

&nbsp;

You'll see "Erasing flash memory. Please wait..." This will eventually be followed by "Finished." and the amount of time it took to erase.

**Do not disconnect!** Immediately continue on to programming the ESP32-S2/S3.

![factory_reset___esp32_s2_WebSerial_ESPTool_erase_board_text.png](https://cdn-learn.adafruit.com/assets/assets/000/106/947/medium640/factory_reset___esp32_s2_WebSerial_ESPTool_erase_board_text.png?1638491869)

Danger: 

## Flash the Bootloader **.bin** File
Programming the ESP32-S2/S3 can be done with up to four files at different locations, but with the board-specific bootloader **.bin** file, which you should have downloaded under **Step 1** on this&nbsp;page, you only need to use one file.

Click on the first **Choose a file...**. (The tool will only attempt to program buttons with a file and a unique location.) Then, select the bootloader **.bin** file you downloaded in Step 1 that matches your board.

Verify that the&nbsp; **Offset** &nbsp;box next to the file location you used is (0x) **0**.

![install_uf2_bootloader_adafruit_products_image_(3).png](https://cdn-learn.adafruit.com/assets/assets/000/101/574/medium640/install_uf2_bootloader_adafruit_products_image_%283%29.png?1618608677)

Once you choose a file, the button text will change to match your filename. You can then select the **Program** button to begin flashing.

![factory_reset___esp32_s2_s3_Program.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/449/medium640/factory_reset___esp32_s2_s3_Program.jpg?1667580433)

A progress bar will appear and after a minute or two, you will have written the firmware.

![factory_reset___esp32_s2_s3_Programming.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/450/medium640/factory_reset___esp32_s2_s3_Programming.jpg?1667580456)

Once completed, you can skip down to the section titled Reset the Board.

## Step 3: Alternative B. The&nbsp;`esptool.py` Method (for advanced users)
Danger: If you used Adafruit WebSerial ESPTool, you do not need to complete the steps in this section!

Once you have entered ROM bootloader mode, you can then&nbsp;[use Espressif's esptool program](https://github.com/espressif/esptool)&nbsp;to communicate with the chip!&nbsp;`esptool`&nbsp;is the 'official' programming tool and is the most common/complete way to program an ESP chip.

## Install `esptool.py`

You will need to use the command line or Terminal to install and run&nbsp;`esptool`.

You will also need to have pip and Python installed (any version!).

Install the latest version using pip (you may be able to run&nbsp;`pip`&nbsp;without the&nbsp;`3`&nbsp;depending on your setup):

`pip3 install --upgrade esptool`

Then, you can run:

`esptool.py`

Info: 

## Test the Installation

Run&nbsp;`esptool.py`&nbsp;in a new terminal/command line and verify you get something like the below:

![](https://cdn-learn.adafruit.com/assets/assets/000/107/692/medium800/factory_reset___esp32_s2_install_uf2_bootloader_adafruit_products_image_%282%29.png?1641494911)

## Find the Serial Port

First, you need to determine the name of the serial port you board has when it's plugged in and ROM bootloader mode.

- For Windows, it will be a COM port, such as `COM5`. Look in Device Manager -\> Ports.
- For macOS, you can do `ls /dev/tty.*` in a Terminal to find the names of the serial ports.&nbsp;
- For Linux, you can do ls `/dev/tty*` in a terminal window. The name is often /dev/ttyACM0 or similar.

If you are not sure you've found the right port, unplug the board, and see if the port disappears.

For more information on determining serial ports, follow these links for help on [Windows](https://learn.adafruit.com/welcome-to-circuitpython/advanced-serial-console-on-windows#whats-the-com-2977217), [macOS](https://learn.adafruit.com/welcome-to-circuitpython/advanced-serial-console-on-mac-and-linux#whats-the-port-2977243), or [Linux](https://learn.adafruit.com/welcome-to-circuitpython/advanced-serial-console-on-linux#whats-the-port-3104855).

## Connect

Run the following command, replacing the identifier after&nbsp;`--port`&nbsp;with the&nbsp;`COMxx`,&nbsp;`/dev/cu.usbmodemxx`&nbsp;or&nbsp;`/dev/ttySxx`&nbsp;you found above.

For example, if you're using Windows, and you think the board is on COM88, type this following:

`esptool.py --port COM88 chip_id`

You should get a notice that it connected over that port and found an ESP32-S2/S3.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/693/medium800/factory_reset___esp32_s2_install_uf2_bootloader_adafruit_products_image_%283%29.png?1641495017)

## Erase the Flash

Before programming the board, it is a good idea to erase the flash. Run the following command.

`esptool.py --port COM88 erase_flash`

You must be connected (by running the command in the previous section) for this command to work as shown.

![](https://cdn-learn.adafruit.com/assets/assets/000/123/927/medium800/factory_reset___esp32_s2_s3_esptool_erase_flash.png?1692912297)

## Flash the UF2 Bootloader

Run this command and replace the serial port name with your matching port and the file you just downloaded

`esptool.py --port COM88 write_flash 0x0 tinyuf2-some-board-0.32.0-combined.bin`

Don't forget to change the `--port` name to match.

Info: Adjust the bootloader filename accordingly if it differs from `tinyuf2-some-board-0.32.0-combined.bin`.

There might be a bit of a 'wait' when programming, where it doesn't seem like it's working. Give it a minute, it has to erase the old flash code which can cause it to seem like it's not running.

You'll finally get an output like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/107/694/medium800/factory_reset___esp32_s2_install_uf2_bootloader_adafruit_products_image.png?1641495051)

Once completed, you can continue to the next section.

## Step 4. Reset the board
The board should restart automatically, and start up the UF2 bootloader. If not, press the reset button to start the bootloader.

The MEMENTO will launch the PyCamera demo. You'll be able to preview the camera view on the TFT, change modes with the buttons and take photos by pressing the **BOOT** button that save to the microSD card.

You've successfully returned installed the UF2 bootloader on your board. If you now want to return the board to a factory reset state, follow the instructions at the top of the page to **Install the Factory Reset Firmware UF2**.

## Older Versions of Chrome
Primary: 

We suggest updating to Chrome 89 or newer, as Web Serial is enabled by default.

If you must continue using an older version of Chrome, follow these steps to enable Web Serial.

If you receive an error like the one shown when you visit the Adafruit WebSerial ESPTool site, you're likely running an older version of Chrome.

**You must be using Chrome 78 or later to use Web Serial.**

![factory_reset___esp32_s2_WebSerial_ESPTool_Not_Supported_Error.png](https://cdn-learn.adafruit.com/assets/assets/000/106/929/medium640/factory_reset___esp32_s2_WebSerial_ESPTool_Not_Supported_Error.png?1638484333)

To enable Web Serial in Chrome versions 78 through 88:

- Visit **chrome://flags** &nbsp;from within Chrome.
- Find and enable the&nbsp; **Experimental Web Platform features**
- **Restart Chrome**

![install_uf2_bootloader_adafruit_products_Enable_Features.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/562/medium640/install_uf2_bootloader_adafruit_products_Enable_Features.jpg?1618608210)

# Step 3: Alternative C. The Flash an Arduino Sketch Method

This section outlines flashing an Arduino sketch onto your ESP32-S2/S3 board, which automatically installs the UF2 bootloader as well. However, it does not allow you to choose which UF2 bootloader to install, so Alternative A or B above are preferred.

## Arduino IDE Setup

If you don't already have the Arduino IDE installed, the first thing you will need to do is to download the latest release of the Arduino IDE. ESP32-S2/S3 requires **version 1.8** &nbsp;or higher. Click the link to download the latest.

[Arduino IDE Download](https://www.arduino.cc/en/software)
After you have downloaded and installed **&nbsp;** the latest version of Arduino IDE, you will need to start the IDE&nbsp;and navigate to&nbsp;the&nbsp; **Preferences** &nbsp;menu. You can access it from the&nbsp; **File \> Preferences** menu in&nbsp;Windows&nbsp;or&nbsp;Linux, or the&nbsp; **Arduino \> Preferences** menu on&nbsp;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://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json`

Add the URL to the the **Additional Boards Manager URLs** field (highlighted in red below).

![](https://cdn-learn.adafruit.com/assets/assets/000/107/697/medium800/factory_reset___esp32_s2_CP_Template_ESP32-S2_factory_reset_Arduino_preferences_window.png?1641495433)

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

In the **Tools \> Boards** menu you should see the **ESP32 Arduino** menu. In the expanded menu, it should contain the ESP32 boards along with all the latest ESP32-S2 boards.

Now that your IDE is setup, you can continue on to loading the sketch.

## Load the Blink Sketch
In the&nbsp; **Tools \> Boards** &nbsp;menu you should see the&nbsp; **ESP32 Arduino** &nbsp;menu. In the expanded menu, look for the menu option for the&nbsp; **Adafruit pyCamera S3** , and click on it to choose it.

Open the Blink sketch by clicking through **File \> Examples \> 01.Basics \> Blink**.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/696/medium800/factory_reset___esp32_s2_Arduino_Template_RP2040_open_Blink.png?1641495423)

For the Arduino IDE to upload TinyUF2 you must select a TinyUF2 partition layout, under the&nbsp; **Tools \> Partition Scheme** &nbsp;menu.

If you have a 4MB board, won't be doing Over-The-Air firmware updates (OTA), or are unsure, then choose the 'No OTA' TinyUF2 entry.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/883/medium800/adafruit_products_pjIhorTc9w.png?1754610534)

Finally, click Upload from the sketch window.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/885/medium800/adafruit_products_Bvj2oHayFn.png?1754610624)

Once successfully uploaded, the little red LED will begin blinking once every second. At that point, you can now enter the bootloader.

Warning: 

# Adafruit MEMENTO Camera Board

## Downloads

## Files

- [ESP32-S3 product page with resources](https://www.espressif.com/en/products/socs/esp32-s3)
- [ESP32-S3 datasheet](https://cdn-learn.adafruit.com/assets/assets/000/119/042/original/esp32-s3_datasheet_en.pdf?1677679796)
- [ESP32-S3 Technical Reference](https://cdn-learn.adafruit.com/assets/assets/000/119/043/original/esp32-s3_technical_reference_manual_en.pdf?1677679919)
- [OV5640 Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/118/306/original/ov5640_datasheet.pdf?1675869959)
- [OV5640 Register Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/118/994/original/OV5640_datasheet.pdf?1677598686)
- [OV5640 Firmware User Guide](https://cdn-learn.adafruit.com/assets/assets/000/126/084/original/ov5640-firmware-user-guide.pdf?1700151367)
- [EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-MEMENTO-PCB)
- [3D Models on GitHub](https://github.com/adafruit/Adafruit_CAD_Parts/tree/main/5420%20MEMENTO)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20MEMENTO%20Camera%20Board.fzpz)
- [Factory Test Firmware Code](https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/main/Factory_Tests/Adafruit_MEMENTO_Factory_Test)

## Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/126/630/medium800/adafruit_products_schem.png?1702564877)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/908/medium800/adafruit_products_mementoSchem2.png?1733256541)

![](https://cdn-learn.adafruit.com/assets/assets/000/126/631/medium800/adafruit_products_fab.png?1702564885 dimensions are in inches)

## 3D Model
![](https://cdn-learn.adafruit.com/assets/assets/000/126/781/medium800thumb/adafruit_products_5420_MEMENTO.jpg?1703081290)


## Primary Products

### MEMENTO - Python Programmable DIY Camera - Bare Board

[MEMENTO - Python Programmable DIY Camera - Bare Board](https://www.adafruit.com/product/5420)
Make memories, or just a cool camera-based project,&nbsp;with **Adafruit's MEMENTO Camera Board**. It's a development board with everything you need to create programmable camera and vision projects: with a camera module, TFT preview screen, buttons, SD card slot and...

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

## Featured Products

### Adafruit MEMENTO Camera Enclosure & Hardware Kit

[Adafruit MEMENTO Camera Enclosure & Hardware Kit](https://www.adafruit.com/product/5843)
Once you've picked up your **MEMENTO Camera** and you're ready to take it out into the world, here is a chic and minimalist enclosure that will look great on the runways of Paris or the street photography of New York City! These front and back plates have been...

In Stock
[Buy Now](https://www.adafruit.com/product/5843)
[Related Guides to the Product](https://learn.adafruit.com/products/5843/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)
### 256MB Micro SD Memory Card

[256MB Micro SD Memory Card](https://www.adafruit.com/product/5251)
Add storage in a jiffy using this **256MB microSD card**. Preformatted to FAT32, so it works out of the packaging with our projects. Works great with any device in the Adafruit shop that uses microSD cards. Ideal for use with Feathers, data loggers, or small Linux SBCs (not good...

In Stock
[Buy Now](https://www.adafruit.com/product/5251)
[Related Guides to the Product](https://learn.adafruit.com/products/5251/guides)
### 8GB Class 10 SD/MicroSD Memory Card - SD Adapter Included

[8GB Class 10 SD/MicroSD Memory Card - SD Adapter Included](https://www.adafruit.com/product/2692)
Add mega-storage in a jiffy using this 8 GB micro-SD card. It comes with a SD adapter so you can use it with any of our shields or adapters! Preformatted to FAT so it works out of the box with our projects. Tested and works great with our [Wave...](http://www.adafruit.com/products/94)

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

## Related Guides

- [MEMENTO Focus Stacking](https://learn.adafruit.com/memento-focus-stacking.md)
- [MEMENTO Camera Quick Start Guide](https://learn.adafruit.com/memento-camera-quick-start-guide.md)
- [Set up Web Workflow on the Adafruit MEMENTO](https://learn.adafruit.com/set-up-web-workflow-on-the-adafruit-memento.md)
- [Remote Shutter Button for MEMENTO](https://learn.adafruit.com/memento-shutter.md)
- [DIY IoT Doorbell Camera with MEMENTO](https://learn.adafruit.com/diy-iot-doorbell-camera-with-memento.md)
- [Memento Photo Capture with itsaSNAP](https://learn.adafruit.com/memento-photo-capture-with-itsasnap.md)
- [Facial Detection and Recognition with MEMENTO](https://learn.adafruit.com/facial-detection-and-recognition-with-memento.md)
- [OpenAI Image Descriptors with MEMENTO](https://learn.adafruit.com/openai-image-descriptors-with-memento.md)
- [ePaper Camera](https://learn.adafruit.com/epaper-camera.md)
- [AdaBox 021](https://learn.adafruit.com/adabox021.md)
- [MEMENTO Wireless Remote with TouchOSC](https://learn.adafruit.com/memento-wireless-remote.md)
- [IoT Bird Feeder with Camera](https://learn.adafruit.com/iot-window-bird-feeder-with-camera.md)
- [Adafruit LTC4316 I2C Address Translator](https://learn.adafruit.com/adafruit-ltc4316-i2c-address-translator.md)
- [Adafruit MMC5603 - Triple-axis Magnetometer](https://learn.adafruit.com/adafruit-mmc5603-triple-axis-magnetometer.md)
- [Adafruit Pixel Shifter](https://learn.adafruit.com/adafruit-pixel-shifter.md)
