All Projects → adafruit → circuitpython

adafruit / circuitpython

Licence: Unknown, Unknown licenses found Licenses found Unknown LICENSE Unknown license.rst
CircuitPython - a Python implementation for teaching coding with microcontrollers

Projects that are alternatives of or similar to circuitpython

AutomationShield
Arduino library and MATLAB/Simulink API for the AutomationShield Arduino expansion boards for control engineering education.
Stars: ✭ 22 (-99.29%)
Mutual labels:  education, microcontroller, embedded
CircuitPython-online-IDE
CircuitPython online IDE
Stars: ✭ 15 (-99.52%)
Mutual labels:  education, circuitpython
ICM-2018
Syllabus for ITP Foundation Course Introduction to Computational Media, Fall 2018
Stars: ✭ 57 (-98.16%)
Mutual labels:  education, beginner
Learn Vim
Vim 实操教程(Learning Vim)Vim practical tutorial.
Stars: ✭ 1,166 (-62.35%)
Mutual labels:  education, beginner
Littlefs
A little fail-safe filesystem designed for microcontrollers
Stars: ✭ 2,488 (-19.66%)
Mutual labels:  microcontroller, embedded
Berry
A ultra-lightweight embedded scripting language optimized for microcontrollers.
Stars: ✭ 206 (-93.35%)
Mutual labels:  microcontroller, embedded
CapableRobot USBHub Driver
www.crowdsupply.com/capable-robot-components/programmable-usb-hub
Stars: ✭ 17 (-99.45%)
Mutual labels:  embedded, circuitpython
Chino Os
A real time operating system for IoT written in C++
Stars: ✭ 139 (-95.51%)
Mutual labels:  microcontroller, embedded
microS2
microS2 - An esp32-s2 based development board 🚀
Stars: ✭ 18 (-99.42%)
Mutual labels:  microcontroller, circuitpython
xForth
Experimental Forth cross compiler for tiny devices
Stars: ✭ 53 (-98.29%)
Mutual labels:  microcontroller, embedded
ewok-kernel
A secure and high performances microkernel for building secure MCU-based IoTs
Stars: ✭ 69 (-97.77%)
Mutual labels:  microcontroller, embedded
Nrf Hal
A Rust HAL for the nRF family of devices
Stars: ✭ 186 (-93.99%)
Mutual labels:  microcontroller, embedded
Micropython
MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems
Stars: ✭ 13,439 (+333.94%)
Mutual labels:  microcontroller, embedded
pumbaa
Python on Simba.
Stars: ✭ 61 (-98.03%)
Mutual labels:  microcontroller, embedded
Lib Python
Blynk IoT library for Python and Micropython
Stars: ✭ 140 (-95.48%)
Mutual labels:  microcontroller, embedded
Learn Vim
Learning Vim and Vimscript doesn't have to be hard. This is the guide that you're looking for.
Stars: ✭ 7,221 (+133.16%)
Mutual labels:  education, beginner
Utensor
TinyML AI inference library
Stars: ✭ 1,295 (-58.19%)
Mutual labels:  microcontroller, embedded
Tiny Json
The tiny-json is a versatile and easy to use json parser in C suitable for embedded systems. It is fast, robust and portable.
Stars: ✭ 127 (-95.9%)
Mutual labels:  microcontroller, embedded
Open Electronics
📚 💻 Great Resources for Electronics Enthusiasts
Stars: ✭ 242 (-92.19%)
Mutual labels:  education, microcontroller
Embedded UKF Library
A compact Unscented Kalman Filter (UKF) library for Teensy4/Arduino system (or any real time embedded system in general)
Stars: ✭ 31 (-99%)
Mutual labels:  microcontroller, embedded

CircuitPython

https://s3.amazonaws.com/adafruit-circuit-python/CircuitPython_Repo_header_logo.png

Build Status Doc Status License Discord Weblate

circuitpython.org | Get CircuitPython | Documentation | Contributing | Branding | Differences from Micropython | Project Structure

CircuitPython is a beginner friendly, open source version of Python for tiny, inexpensive computers called microcontrollers. Microcontrollers are the brains of many electronics including a wide variety of development boards used to build hobby projects and prototypes. CircuitPython in electronics is one of the best ways to learn to code because it connects code to reality. Simply install CircuitPython on a supported USB board usually via drag and drop and then edit a code.py file on the CIRCUITPY drive. The code will automatically reload. No software installs are needed besides a text editor (we recommend Mu for beginners.)

Starting with CircuitPython 7.0.0, some boards may only be connectable over Bluetooth Low Energy (BLE). Those boards provide serial and file access over BLE instead of USB using open protocols. (Some boards may use both USB and BLE.) BLE access can be done from a variety of apps including code.circuitpython.org.

CircuitPython features unified Python core APIs and a growing list of 300+ device libraries and drivers that work with it. These libraries also work on single board computers with regular Python via the Adafruit Blinka Library.

CircuitPython is based on MicroPython. See below for differences. Most, but not all, CircuitPython development is sponsored by Adafruit and is available on their educational development boards. Please support both MicroPython and Adafruit.

Get CircuitPython

Official binaries for all supported boards are available through circuitpython.org/downloads. The site includes stable, unstable and continuous builds. Full release notes are available through GitHub releases as well.

Documentation

Guides and videos are available through the Adafruit Learning System under the CircuitPython category. An API reference is also available on Read the Docs. A collection of awesome resources can be found at Awesome CircuitPython.

Specifically useful documentation when starting out:

Code Search

GitHub doesn't currently support code search on forks. Therefore, CircuitPython doesn't have code search through GitHub because it is a fork of MicroPython. Luckily, SourceGraph has free code search for public repos like CircuitPython. So, visit sourcegraph.com/github.com/adafruit/circuitpython to search the CircuitPython codebase online.

Contributing

See CONTRIBUTING.md for full guidelines but please be aware that by contributing to this project you are agreeing to the Code of Conduct. Contributors who follow the Code of Conduct are welcome to submit pull requests and they will be promptly reviewed by project admins. Please join the Discord too.

Branding

While we are happy to see CircuitPython forked and modified, we'd appreciate it if forked releases not use the name "CircuitPython" or the Blinka logo. "CircuitPython" means something special to us and those who learn about it. As a result, we'd like to make sure products referring to it meet a common set of requirements.

If you'd like to use the term "CircuitPython" and Blinka for your product here is what we ask:

  • Your product is supported by the primary "adafruit/circuitpython" repo. This way we can update any custom code as we update the CircuitPython internals.
  • Your product is listed on circuitpython.org (source here). This is to ensure that a user of your product can always download the latest version of CircuitPython from the standard place.
  • Your product supports at least one standard "Workflow" for serial and file access: * With a user accessible USB plug which appears as a CIRCUITPY drive when plugged in. * With file and serial access over Bluetooth Low Energy using the BLE Workflow. * With file access over WiFi using the WiFi Workflow with serial access over USB and/or WebSocket.
  • Boards that do not support the USB Workflow should be clearly marked.

If you choose not to meet these requirements, then we ask you call your version of CircuitPython something else (for example, SuperDuperPython) and not use the Blinka logo. You can say it is "CircuitPython-compatible" if most CircuitPython drivers will work with it.


Differences from MicroPython

CircuitPython:

  • Supports native USB on most boards and BLE otherwise, allowing file editing without special tools.
  • Floats (aka decimals) are enabled for all builds.
  • Error messages are translated into 10+ languages.
  • Concurrency within Python is not well supported. Interrupts and threading are disabled. async/await keywords are available on some boards for cooperative multitasking. Some concurrency is achieved with native modules for tasks that require it such as audio file playback.

Behavior

  • The order that files are run and the state that is shared between them. CircuitPython's goal is to clarify the role of each file and make each file independent from each other.
    • boot.py runs only once on start up before workflows are initialized. This lays the ground work for configuring USB at startup rather than it being fixed. Since serial is not available, output is written to boot_out.txt.
    • code.py (or main.py) is run after every reload until it finishes or is interrupted. After it is done running, the vm and hardware is reinitialized. This means you cannot read state from code.py in the REPL anymore, as the REPL is a fresh vm. CircuitPython's goal for this change includes reducing confusion about pins and memory being used.
    • After the main code is finished the REPL can be entered by pressing any key.
    • Autoreload state will be maintained across reload.
  • Adds a safe mode that does not run user code after a hard crash or brown out. This makes it possible to fix code that causes nasty crashes by making it available through mass storage after the crash. A reset (the button) is needed after it's fixed to get back into normal mode.
  • RGB status LED indicating CircuitPython state. - One green flash - code completed without error. - Two red flashes - code ended due to an exception. - Three yellow flashes - safe mode. May be due to CircuitPython internal error.
  • Re-runs code.py or other main file after file system writes by a workflow. (Disable with supervisor.disable_autoreload())
  • Autoreload is disabled while the REPL is active.
  • Main is one of these: code.txt, code.py, main.py, main.txt
  • Boot is one of these: boot.py, boot.txt

API

  • Unified hardware APIs. Documented on ReadTheDocs.
  • API docs are Python stubs within the C files in shared-bindings.
  • No machine API.

Modules

  • No module aliasing. (uos and utime are not available as os and time respectively.) Instead os, time, and random are CPython compatible.
  • New storage module which manages file system mounts. (Functionality from uos in MicroPython.)
  • Modules with a CPython counterpart, such as time, os and random, are strict subsets of their CPython version. Therefore, code from CircuitPython is runnable on CPython but not necessarily the reverse.
  • tick count is available as time.monotonic()

Project Structure

Here is an overview of the top-level source code directories.

Core

The core code of MicroPython is shared amongst ports including CircuitPython:

  • docs High level user documentation in Sphinx reStructuredText format.
  • drivers External device drivers written in Python.
  • examples A few example Python scripts.
  • extmod Shared C code used in multiple ports' modules.
  • lib Shared core C code including externally developed libraries such as FATFS.
  • logo The CircuitPython logo.
  • mpy-cross A cross compiler that converts Python files to byte code prior to being run in MicroPython. Useful for reducing library size.
  • py Core Python implementation, including compiler, runtime, and core library.
  • shared-bindings Shared definition of Python modules, their docs and backing C APIs. Ports must implement the C API to support the corresponding module.
  • shared-module Shared implementation of Python modules that may be based on common-hal.
  • tests Test framework and test scripts.
  • tools Various tools, including the pyboard.py module.

Ports

Ports include the code unique to a microcontroller line.

Supported Support status
atmel-samd SAMD21 stable | SAMD51 stable
cxd56 stable
espressif ESP32-C3 beta | ESP32-S2 stable | ESP32-S3 beta
litex alpha
mimxrt10xx alpha
nrf stable
raspberrypi stable
stm F4 stable | others beta
unix alpha
  • stable Highly unlikely to have bugs or missing functionality.
  • beta Being actively improved but may be missing functionality and have bugs.
  • alpha Will have bugs and missing functionality.

Boards

  • Each port has a boards directory containing boards which belong to a specific microcontroller line.
  • A list of native modules supported by a particular board can be found here.

Back to Top

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].