Welcome to CircuitPython!

Welcome to CircuitPython!

Created by lady ada



Last updated on 2024-06-03 02:15:56 PM EDT

?Adafruit Industries

Page 1 of 155

Table of Contents

Welcome To CircuitPython

? This guide will get you started with CircuitPython!

What is CircuitPython?

? CircuitPython is based on Python ? Why would I use CircuitPython?

Installing the Mu Editor

? Download and Install Mu ? Starting Up Mu ? Using Mu

Installing CircuitPython

? Download the latest version! ? Windows 7 and 8.1 Drivers ? Start the UF2 Bootloader ? For most boards: ? For RP2040 boards: ? Bootloader Mode ? For most boards: ? For RP2040 boards: ? Install CircuitPython ? What's the difference between CIRCUITPY and boardnameBOOT or RPI-RP2? ? Bootloader Drive Names

Windows 7 and 8.1 Drivers

The CIRCUITPY Drive

? Boards Without CIRCUITPY

Creating and Editing Code

? Creating Code ? Editing Code ? Back to Editing Code... ? Naming Your Program File

Exploring Your First CircuitPython Program

? Imports & Libraries ? Setting Up The LED ? Loop-de-loops ? What Happens When My Code Finishes Running? ? What if I Don't Have the Loop?

Connecting to the Serial Console

? Are you using Mu? ? Serial Console Issues or Delays on Linux ? Setting Permissions on Linux ? Using Something Else?

Interacting with the Serial Console

?Adafruit Industries

7 7 9 11

18 19 20 25

28 31

Page 2 of 155

The REPL

? Entering the REPL ? Interacting with the REPL ? Returning to the Serial Console

CircuitPython Libraries

? The Adafruit Learn Guide Project Bundle ? The Adafruit CircuitPython Library Bundle ? Downloading the Adafruit CircuitPython Library Bundle ? The CircuitPython Community Library Bundle ? Downloading the CircuitPython Community Library Bundle ? Understanding the Bundle ? Example Files ? Copying Libraries to Your Board ? Understanding Which Libraries to Install ? Example: ImportError Due to Missing Library ? Library Install on Non-Express Boards ? Updating CircuitPython Libraries and Examples ? CircUp CLI Tool

CircuitPython Hardware

? Circuit Playground Express ? Circuit Playground Bluefruit ? Circuit Playground Express or Bluefruit? ? QT Py RP2040 ? Feather M4 Express ? Feather RP2040 ? Metro M4 ? ItsyBitsy M4 Starter Kit

Welcome to the Community!

? Adafruit Discord ? ? Adafruit GitHub ? Adafruit Forums ? Read the Docs

CircuitPython Documentation

? CircuitPython Core Documentation ? CircuitPython Library Documentation

Advanced Setup

Recommended Editors

? Recommended editors ? Recommended only with particular settings or add-ons ? Editors that are NOT recommended

Library File Types and Frozen Libraries

? RAM vs Filesystem Space ? .mpy Library Files ? What is an .mpy file? ? Creating an .mpy File ? .py Library Files. ? What is a .py file?

?Adafruit Industries

34 38

49

55 64 71 71 73

Page 3 of 155

? Frozen Libraries ? What is a frozen library? ? Project Bundle and Frozen Libraries ? Library File Priority ? What library files does CircuitPython look for? ? Where does CircuitPython look for library files? ? Building CircuitPython with an Updated Frozen Library ? What's the Real Difference? ? Memory Usage between .mpy and .py ? Using gc.mem_free() to Check Your Bytes ? Common Issues and Solutions ? .mpy Failing When It Worked Previously ? Memory Allocation ? Memory Fragmentation ? Import Order Can Matter ? Library Structure Not Intact or in Improper Directory ? Don't Name Your Test Code the Same as a Library

PyCharm and CircuitPython

? Disable Auto-save ? Creating a project on a computer's file system ? Install circuitpython-stubs ? Device Specific Board Stubs ? Install Libraries ? Serial console in the terminal pane

Renaming CIRCUITPY

? Renaming CIRCUITPY on Mac ? Renaming CIRCUITPY on Windows ? Renaming CIRCUITPY on Linux ? Renaming CIRCUITPY through CircuitPython ? Reverting to CIRCUITPY

Advanced Serial Console on Windows

? Windows 7 and 8.1 ? What's the COM? ? Install Putty

Advanced Serial Console on Mac

? What's the Port? ? Connect with screen

Advanced Serial Console on Linux

? What's the Port? ? Connect with screen ? Permissions on Linux

Non-UF2 Installation

? Espressif Boards without UF2 Bootloaders ? STM Boards ? Flashing with Bossac - For Non-Express Feather M0's & Arduino Zero ? Command-Line ahoy! ? Download Latest CircuitPython Firmware ? Download BOSSA ? Test bossac ? Get Into the Bootloader

?Adafruit Industries

88 94 98 101 103 107

Page 4 of 155

? Run the bossac Command

Frequently Asked Questions

? Using Older Versions ? Python Arithmetic ? Wireless Connectivity ? Asyncio and Interrupts ? Status RGB LED ? Memory Issues ? Unsupported Hardware

Troubleshooting

? Always Run the Latest Version of CircuitPython and Libraries ? I have to continue using CircuitPython 7.x or earlier. Where can I find compatible libraries? ? macOS Sonoma 14.x: Disk Errors Writing to CIRCUITPY ? Bootloader (boardnameBOOT) Drive Not Present ? Windows Explorer Locks Up When Accessing boardnameBOOT Drive ? Copying UF2 to boardnameBOOT Drive Hangs at 0% Copied ? CIRCUITPY Drive Does Not Appear or Disappears Quickly ? Device Errors or Problems on Windows ? Serial Console in Mu Not Displaying Anything ? code.py Restarts Constantly ? CircuitPython RGB Status Light ? CircuitPython 7.0.0 and Later ? CircuitPython 6.3.0 and earlier ? Serial console showing ValueError: Incompatible .mpy file ? CIRCUITPY Drive Issues ? Safe Mode ? To erase CIRCUITPY: storage.erase_filesystem() ? Erase CIRCUITPY Without Access to the REPL ? For the specific boards listed below: ? For SAMD21 non-Express boards that have a UF2 bootloader: ? For SAMD21 non-Express boards that do not have a UF2 bootloader: ? Running Out of File Space on SAMD21 Non-Express Boards ? Delete something! ? Use tabs ? On MacOS? ? Prevent & Remove MacOS Hidden Files ? Copy Files on MacOS Without Creating Hidden Files ? Other MacOS Space-Saving Tips ? Device Locked Up or Boot Looping

"Uninstalling" CircuitPython

? Backup Your Code ? Moving Circuit Playground Express to MakeCode ? Moving to Arduino

CircuitPython Essentials

How Do I Learn Python?

? Python for Beginner Non-Programmers ? Python for Programmers ? Python FAQs ? Python Success Stories ? Final Note

115 120

140 143 143

?Adafruit Industries

Page 5 of 155

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download