Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsJul 16, 2026·3 min de lecture

CircuitPython — Python for Microcontrollers and Embedded Devices

An Adafruit-maintained fork of MicroPython optimized for learning and rapid prototyping on microcontrollers, with a USB drive workflow and 400+ hardware libraries.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
CircuitPython
Commande d'installation directe
npx -y tokrepo@latest install abc27e9a-80d0-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

CircuitPython is an education-focused implementation of Python 3 for microcontrollers, maintained by Adafruit. It simplifies embedded development by letting you write Python code directly on a USB-mounted drive without installing compilers, IDEs, or flashing tools, making hardware programming accessible to beginners and rapid prototypers.

What CircuitPython Does

  • Runs Python 3 directly on microcontrollers with 256 KB+ RAM and 32-bit processors
  • Mounts the board as a USB drive so code files can be edited with any text editor
  • Provides 400+ libraries for sensors, displays, motors, LEDs, and communication protocols
  • Includes a serial REPL console for interactive debugging over USB
  • Supports 500+ boards from Adafruit, Raspberry Pi, SparkFun, Seeed Studio, and others

Architecture Overview

CircuitPython is a fork of MicroPython with modifications for USB workflow, API consistency, and beginner friendliness. It runs a bytecode interpreter on the microcontroller that reads code.py from the filesystem on each reset. The USB stack provides both a mass storage device (for code editing) and a CDC serial port (for REPL). Hardware abstraction layers map board-specific pins and peripherals to a consistent Python API across different chip families including RP2040, ESP32-S3, nRF52840, and SAMD51.

Self-Hosting & Configuration

  • Download the correct UF2 firmware for your board from circuitpython.org
  • Enter bootloader mode (usually double-tap reset) and drag the UF2 file to the boot drive
  • Place Python code in code.py on the CIRCUITPY drive; it runs automatically on save
  • Install libraries by copying .mpy files from the Adafruit CircuitPython Bundle to the lib/ folder
  • Use circup CLI tool to manage library installation and updates: pip install circup && circup install adafruit_neopixel

Key Features

  • No toolchain required: edit code with any text editor, save to USB drive, and it runs
  • Built-in USB HID, MIDI, and serial support for custom input devices and instruments
  • Wi-Fi and Bluetooth support on ESP32 and nRF boards for IoT applications
  • displayio library for driving OLED, TFT, and e-ink displays with graphics and text
  • Active community with weekly releases and broad board support

Comparison with Similar Tools

  • MicroPython — More portable and lower-level; CircuitPython prioritizes beginner experience and USB workflow
  • Arduino (C/C++) — Faster execution and more memory-efficient; CircuitPython trades performance for ease of use
  • PlatformIO — Professional embedded toolchain; CircuitPython needs no build tools at all
  • Raspberry Pi OS — Full Linux on Pi hardware; CircuitPython runs on bare-metal microcontrollers
  • Espressif IDF — Low-level ESP32 SDK; CircuitPython abstracts hardware for rapid prototyping

FAQ

Q: What boards are supported? A: Over 500 boards including Raspberry Pi Pico, Adafruit Feather, ESP32-S3 boards, and many others. See circuitpython.org/downloads for the full list.

Q: Is CircuitPython fast enough for real projects? A: For sensor reading, display driving, and IoT tasks it works well. For timing-critical applications like audio DSP or high-frequency PWM, C/C++ may be more appropriate.

Q: How is it different from MicroPython? A: CircuitPython focuses on USB drive workflow, API consistency across boards, and beginner documentation. MicroPython supports more chips and offers lower-level access.

Q: Can I use regular Python packages? A: No. CircuitPython uses its own library ecosystem optimized for microcontrollers. Standard CPython packages are too large for embedded use.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires