Software:CircuitPython

From HandWiki
CircuitPython
Logo of the Blinka library, a compatibility layer for CircuitPython
Logo of the Blinka library, a compatibility layer for CircuitPython
Original author(s)Adafruit Industries
Initial releaseJuly 19, 2017; 8 years ago (2017-07-19)[1]
Repositoryhttps://github.com/adafruit/circuitpython
Written inC[2]
PlatformSupported microcontrollers and single-board computers
TypePython implementation
LicenseMIT license[3]
Websitecircuitpython.org

CircuitPython[4] is an open-source derivative of the MicroPython programming language targeted toward students and beginners. Development of CircuitPython is supported by Adafruit Industries. It is a software implementation of the Python 3 programming language, written in C.[2] It has been ported to run on several modern microcontrollers.

CircuitPython consists of a Python compiler to bytecode and a runtime interpreter of that bytecode that runs on the microcontroller hardware. The user is presented with an interactive prompt (the REPL) to execute supported commands immediately. Included are a selection of core Python libraries. CircuitPython includes modules which give the programmer access to the low-level hardware of supported products as well as higher-level libraries for beginners.[5]

CircuitPython is a fork of MicroPython, originally created by Damien George.[6] The MicroPython community continues to discuss[7] forks of MicroPython into variants such as CircuitPython.

CircuitPython is targeted to be compatible with CPython, the reference implementation of the Python programming language.[8] Programs written for CircuitPython-compatible boards may not run unmodified on other platforms such as the Raspberry Pi.[9]

Usage

CircuitPython is being used as an emerging alternative solution for microcontroller programming, which is usually done in C, C++, or assembly. The language has also seen uptake in making small, handheld video game devices.[10] Developer Chris Young has ported his infrared transmit-and-receive software to CircuitPython to provide interactivity and to aid those with accessibility issues.[11]

Community

The user community support includes a Discord chat room and product support forums.[12] A Twitter account dedicated to CircuitPython news was established in 2018.[13] A newsletter, Python on Microcontrollers, is published weekly since 15 November, 2016 by Adafruit to provide news and information on CircuitPython, MicroPython, and Python on single board computers.[14] A Reddit subreddit, r/CircuitPython, provides news on CircuitPython and related news and projects and has about 4,300 members.[15]

Hardware support

As of July 6, 2025 version 9.2.8 supports over 608 different micro controller boards[16]

The version 9.1.0 supports a range of platforms, called "ports":[17]

  • atmel-samd: Microchip SAMD21, SAMx5x
  • cxd56: Sony Spresense
  • espressif: Espressif ESP32, ESP32-S2, ESP32-S3, ESP32-C2, ESP32-C3, ESP32-C6
  • nordic: Nordic nRF52840, nRF52833
  • raspberrypi: Raspberry Pi RP2040, RP2350
  • stm: ST STM32F4 chip family

These ports are considered alpha and will have bugs and missing functionality:

  • broadcom: Raspberry Pi boards such as RPi 4, RPi Zero 2W (bare metal)
  • litex: fomu
  • mimxrt10xx: NXP i.MX RT10xxx
  • renode: hardware simulator
  • silabs: Silicon Labs MG24 family
  • stm: ST non-STM32F4 chip families

Previous versions supported the ESP8266 microcontroller, but its support was dropped in version 4.[18]

Blinka Software Abstraction Layer

CircuitPython code may run on MicroPython or CPython using the Adafruit written Blinka compatibility layer.[19] It acts as a translation layer between CircuitPython code and underlying code. This allows CircuitPython code to run on many more devices including a wide range of single-board computers which are listed on circuitpython.org.[20] It is a pip installable Python library. The CircuitPython runtime is not used, as documented in the guide CircuitPython Libraries on Linux and Raspberry Pi.[21]

Modules (Libraries)

Adafruit has fostered a community which has contributed software libraries for more than 488 sensors and drivers.[22][23]

References

  1. Shawcroft, Scott (19 July 2017). "CircuitPython 1.0.0!". Adafruit Industries. https://blog.adafruit.com/2017/07/19/circuitpython-1-0-0/. Retrieved 1 May 2018. 
  2. 2.0 2.1 "adafruit/circuitpython". Adafruit Industries. https://github.com/adafruit/circuitpython. Retrieved 2 May 2018. 
  3. George, Damien P. (4 May 2014). "circuitpython/LICENSE". https://github.com/adafruit/circuitpython/blob/master/LICENSE/micropython. 
  4. "CircuitPython is an education friendly open-source derivative of MicroPython". https://github.com/adafruit/circuitpython. Retrieved 30 April 2018. 
  5. "CircuitPython". Adafruit Industries. https://readthedocs.org/projects/circuitpython/. Retrieved 1 May 2018. 
  6. George, Damien (20 May 2016). "Damien P. George". Damien P. George. http://dpgeorge.net/. Retrieved 1 May 2018. 
  7. "Adafruit CircuitPython". MicroPython.org. https://forum.micropython.org/viewtopic.php?t=2894. Retrieved 2 May 2018. 
  8. Lewis, James (14 February 2018). "Circuit Python adds Python to Microcontrollers". https://www.baldengineer.com/circuit-python.html. Retrieved 2 May 2018. 
  9. Ganne, Simon. "Can I use circuitPython code on my raspberry?". Element 14. https://www.element14.com/community/thread/62774/l/can-i-use-circuitpython-code-on-my-raspberry?displayFullThread=true. 
  10. Dopieralski, Radomir. "CircuitPython LAMEBOY". https://bitbucket.org/thesheep/circuitpython-lameboy. Retrieved 2 May 2018. 
  11. Young, Chris (6 June 2018). "Announcing IRLibCP — a Circuit Python Module for Infrared Transmitting and Receiving". Chris Young. http://tech.cyborg5.com/2017/06/06/announcing-irlibcp-a-circuit-python-module-for-infrared-transmitting-and-receiving/. Retrieved 2 May 2018. 
  12. "Adafruit CircuitPython and MicroPython". Adafruit Industries. https://forums.adafruit.com/viewforum.php?f=60. Retrieved 1 May 2018. 
  13. "CircuitPython". Adfafruit Industries. https://twitter.com/CircuitPython. Retrieved 1 May 2018. 
  14. "The Python on Microcontrollers Newsletter". Adafruit Industries. https://www.adafruitdaily.com/category/circuitpython/. Retrieved 17 July 2024. 
  15. "r/CircuitPython". Adafruit Industries. https://www.reddit.com/r/circuitpython/. Retrieved 17 July 2024. 
  16. "Circuitpython.org downloads". https://circuitpython.org/downloads. 
  17. "CircuitPython 9.1.0". 17 July 2024. https://github.com/adafruit/circuitpython/releases/tag/9.1.0. 
  18. "Why are we dropping support for ESP8266?". Adafruit Industries. https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-for-esp8266. Retrieved 15 April 2019. 
  19. "Blinka". Adafruit Industries. https://circuitpython.org/blinka. Retrieved 17 July 2024. 
  20. "Blinka". Adafruit Industries. https://circuitpython.org/blinka. Retrieved 17 July 2024. 
  21. "CircuitPython Libraries on Linux and Raspberry Pi". Adafruit Industries Industries. https://learn.adafruit.com/circuitpython-on-raspberrypi-linux. Retrieved 17 July 2024. 
  22. "Python on Microcontrollers Newsletter". https://www.adafruitdaily.com/2024/07/15/python-on-microcontrollers-newsletter-circuitpython-9-1-released-arduino-adopts-qwiic-and-so-much-more-circuitpython-python-micropython-thepsf-raspberry_pi/. 
  23. "CircuitPython Libraries". https://circuitpython.org/libraries.