Jump to content

CircuitPython: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
AnomieBOT (talk | contribs)
Rescuing orphaned refs ("6.2.0" from rev 1071875601)
Kittyba (talk | contribs)
→‎Hardware support: Add library section with citations
 
(33 intermediate revisions by 20 users not shown)
Line 1: Line 1:
{{Short description|Programming language}}
{{Short description|Programming language}}
{{Infobox software
{{Infobox software
| name = CircuitPython
| name = CircuitPython
| logo = Adafruit blinka angles-left.svg
| logo = File:Blinka.png
| logo size = 200px
| logo caption = Logo of the Blinka library, a compatibility layer for CircuitPython
| logo size = 200px
| author = Adafruit Industries
| author = [[Adafruit Industries]]
| released = {{Start date and age|2017|07|19}}<ref>{{cite web|first1=Scott|last1=Shawcroft|title=CircuitPython 1.0.0!|url=https://blog.adafruit.com/2017/07/19/circuitpython-1-0-0/|website=Adafruit Blog|publisher=Adafruit Industries|accessdate=1 May 2018}}</ref>
| released = {{Start date and age|2017|07|19}}<ref>{{cite web|first1=Scott|last1=Shawcroft|title=CircuitPython 1.0.0!|url=https://blog.adafruit.com/2017/07/19/circuitpython-1-0-0/|website=Adafruit Blog|date=19 July 2017 |publisher=Adafruit Industries|accessdate=1 May 2018}}</ref>
| latest release version = {{wikidata|property|edit|reference|P348}}
| latest release version = {{wikidata|property|edit|reference|P348}}
| latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}}
| latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}}
| repo = https://github.com/adafruit/circuitpython
| repo = https://github.com/adafruit/circuitpython
| programming language = [[C (programming language)|C]]<ref name="CP-GitHub" />
| programming language = [[C (programming language)|C]]<ref name="CP-GitHub" />
| platform = Supported [[microcontroller]]s and [[single-board computer]]s
| platform = microcontroller boards using the Atmel SAMD21, Atmel SAMD51, Nordic nRF52840, and ESP8266 microcontrollers, from Adafruit, SparkFun, Arduino, Particle, and others
| genre = [[Python (programming language)|Python]] implementation
| genre = [[Python (programming language)|Python]] implementation
| license = [[MIT license]]<ref>{{Cite web|url=https://github.com/adafruit/circuitpython/blob/master/LICENSE/micropython|title=circuitpython/LICENSE|last=George|first=Damien P.|date=4 May 2014|website=[[GitHub]]|access-date=1 May 2018}}</ref>
| license = [[MIT license]]<ref>{{Cite web|url=https://github.com/adafruit/circuitpython/blob/master/LICENSE/micropython|title=circuitpython/LICENSE|last=George|first=Damien P.|date=4 May 2014|website=[[GitHub]]|access-date=1 May 2018}}</ref>
| website = {{URL|https://circuitpython.org/}}
| website = {{URL|https://circuitpython.org/}}
}}
}}
'''CircuitPython'''<ref>{{cite web|url=https://github.com/adafruit/circuitpython|title=CircuitPython is an education friendly open-source derivative of MicroPython|website=[[GitHub]]|accessdate=30 April 2018}}</ref> 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 (programming language)|Python]] 3 [[programming language]], written in [[C (programming language)|C]].<ref name="CP-GitHub">{{cite web |title=adafruit/circuitpython|url=https://github.com/adafruit/circuitpython |website=[[GitHub]] |publisher=[[Adafruit Industries]] |accessdate=2 May 2018}}</ref> It has been ported to run on several modern [[microcontroller]]s.
'''CircuitPython'''<ref>{{cite web|url=https://github.com/adafruit/circuitpython|title=CircuitPython is an education friendly open-source derivative of MicroPython|website=[[GitHub]]|accessdate=30 April 2018}}</ref> 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 {{nowrap|[[Python (programming language)|Python]] 3}} [[programming language]], written in [[C (programming language)|C]].<ref name="CP-GitHub">{{cite web |title=adafruit/circuitpython|url=https://github.com/adafruit/circuitpython |website=[[GitHub]] |publisher=[[Adafruit Industries]] |accessdate=2 May 2018}}</ref> It has been ported to run on several modern [[microcontroller]]s.


CircuitPython is a full Python compiler and runtime that runs on the microcontroller hardware. The user is presented with an interactive prompt (the [[read–eval–print loop|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.<ref>{{cite web|title=CircuitPython|url=https://readthedocs.org/projects/circuitpython/|website=[[Read the Docs]]|publisher=Adafruit Industries|accessdate=1 May 2018}}</ref>
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 [[read–eval–print loop|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.<ref>{{cite web|title=CircuitPython|url=https://readthedocs.org/projects/circuitpython/|website=[[Read the Docs]]|publisher=Adafruit Industries|accessdate=1 May 2018}}</ref>


CircuitPython is a fork of MicroPython, originally created by Damien George.<ref>{{cite web|last1=George|first1=Damien|title=Damien P. George|url=http://dpgeorge.net/|publisher=Damien P. George|accessdate=1 May 2018|date=20 May 2016}}</ref> The MicroPython community continues to discuss<ref>{{cite web|title=Adafruit CircuitPython|url=https://forum.micropython.org/viewtopic.php?t=2894|website=MicroPython Forum|publisher=MicroPython.org|accessdate=2 May 2018}}</ref> forks of MicroPython into variants such as CircuitPython.
CircuitPython is a fork of MicroPython, originally created by Damien George.<ref>{{cite web|last1=George|first1=Damien|title=Damien P. George|url=http://dpgeorge.net/|publisher=Damien P. George|accessdate=1 May 2018|date=20 May 2016}}</ref> The MicroPython community continues to discuss<ref>{{cite web|title=Adafruit CircuitPython|url=https://forum.micropython.org/viewtopic.php?t=2894|website=MicroPython Forum|publisher=MicroPython.org|accessdate=2 May 2018}}</ref> forks of MicroPython into variants such as CircuitPython.


CircuitPython is targeted to be compliant with [[CPython]], the reference implementation of the Python programming language.<ref>{{cite web|last1=Lewis|first1=James|title=Circuit Python adds Python to Microcontrollers|url=https://www.baldengineer.com/circuit-python.html|website=The Bald Engineer|accessdate=2 May 2018}}</ref> Programs written for CircuitPython-compatible boards may not run unmodified on other platforms such as the [[Raspberry Pi]].<ref>{{cite web|last1=Ganne|first1=Simon|title=Can I use circuitPython code on my raspberry?|url=https://www.element14.com/community/thread/62774/l/can-i-use-circuitpython-code-on-my-raspberry?displayFullThread=true|website=Element 14 Community|publisher=Element 14}}</ref>
CircuitPython is targeted to be compliant with [[CPython]], the reference implementation of the Python programming language.<ref>{{cite web|last1=Lewis|first1=James|title=Circuit Python adds Python to Microcontrollers|url=https://www.baldengineer.com/circuit-python.html|website=The Bald Engineer|date=14 February 2018 |accessdate=2 May 2018}}</ref> Programs written for CircuitPython-compatible boards may not run unmodified on other platforms such as the [[Raspberry Pi]].<ref>{{cite web|last1=Ganne|first1=Simon|title=Can I use circuitPython code on my raspberry?|url=https://www.element14.com/community/thread/62774/l/can-i-use-circuitpython-code-on-my-raspberry?displayFullThread=true|website=Element 14 Community|publisher=Element 14}}</ref>


== Usage ==
== Usage ==
Line 27: Line 28:


== Community ==
== Community ==
The user community support includes a [[Discord (software)|Discord]] chat room and product support forums.<ref>{{cite web|title=Adafruit CircuitPython and MicroPython|url=https://forums.adafruit.com/viewforum.php?f=60|website=Adafruit Support Forums|publisher=Adafruit Industries|accessdate=1 May 2018}}</ref> A [[Twitter]] account dedicated to CircuitPython news was established in 2018.<ref>{{cite web|title=CircuitPython|url=https://twitter.com/CircuitPython|website=[[Twitter]]|publisher=Adfafruit Industries|accessdate=1 May 2018}}</ref>
The user community support includes a [[Discord (software)|Discord]] chat room and product support forums.<ref>{{cite web|title=Adafruit CircuitPython and MicroPython|url=https://forums.adafruit.com/viewforum.php?f=60|website=Adafruit Support Forums|publisher=Adafruit Industries|accessdate=1 May 2018}}</ref> A [[Twitter]] account dedicated to CircuitPython news was established in 2018.<ref>{{cite web|title=CircuitPython|url=https://twitter.com/CircuitPython|website=[[Twitter]]|publisher=Adfafruit Industries|accessdate=1 May 2018}}</ref> 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.<ref>{{cite web|title=The Python on Microcontrollers Newsletter|url=https://www.adafruitdaily.com/category/circuitpython/|website=Adafruit Daily|publisher=Adafruit Industries|accessdate=17 July 2024}}</ref> A [[Reddit]] subreddit, r/CircuitPython, provides news on CircuitPython and related news and projects and has about 4,300 members.<ref>{{cite web|title=r/CircuitPython|url=https://www.reddit.com/r/circuitpython/|website=Reddit.com|publisher=Adafruit Industries|accessdate=17 July 2024}}</ref>


== Hardware Support ==
== Hardware support ==
The version 9.1.0 supports a range of architectures, called "ports":<ref>{{cite web|title=CircuitPython 9.1.0|url=https://github.com/adafruit/circuitpython/releases/tag/9.1.0|website=GitHub|date=17 July 2024}}</ref>
The version 6.2.0 supports [[Atmel]] SAMD21 and SAMD51 [[Atmel ARM-based processors|microcontrollers]] from [[Microchip Technology]],<ref>{{cite web|last1=Kraft|first1=Caleb|title=CircuitPython Snakes its Way onto Adafruit Hardware|url=https://makezine.com/2017/08/11/circuitpython-snakes-way-adafruit-hardware/|website=Makezine|publisher=Maker Media, Inc.|accessdate=2 May 2018}}</ref> nRF52833 and nRF52840 from [[Nordic Semiconductor]], CXD5602 ([[Spresense]]) from [[Sony]], and [[STM32]] F4-series from [[STMicroelectronics]].<ref name="6.2.0">{{cite web|first1=Dan|last1=Halbert|title=CircuitPython 6.2.0 released!|url=https://blog.adafruit.com/2021/04/05/circuitpython-6-2-0-released/|website=Adafruit Blog|publisher=Adafruit Industries|accessdate=20 April 2021}}</ref> Previous versions supported the [[ESP8266]] microcontroller, but its support was dropped in version 4.<ref>{{cite web |title=Why are we dropping support for ESP8266? |url=https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-for-esp8266 |website=Adafruit.com |publisher=Adafruit Industries |accessdate=15 April 2019}}</ref>

* 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
* 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 machine|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.<ref>{{cite web |title=Why are we dropping support for ESP8266? |url=https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-for-esp8266 |website=Adafruit.com |publisher=Adafruit Industries |accessdate=15 April 2019}}</ref>

=== Blinka Software Abstraction Layer ===

CircuitPython code may run on [[MicroPython]] or [[CPython]] using the Adafruit written Blinka compatibility layer.<ref>{{cite web |title=Blinka |url=https://circuitpython.org/blinka |website=CircuitPython |publisher=Adafruit Industries |accessdate=17 July 2024}}</ref> 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 computer]]s which are listed on circuitpython.org.<ref>{{cite web |title=Blinka |url=https://circuitpython.org/blinka |website=CircuitPython |publisher=Adafruit Industries |accessdate=17 July 2024}}</ref> It is a [[Pip_(package_manager)|pip]] installable Python library. The CircuitPython runtime is not used, as documented in the guide ''CircuitPython Libraries on Linux and Raspberry Pi''.<ref>{{cite web |title=CircuitPython Libraries on Linux and Raspberry Pi |url=https://learn.adafruit.com/circuitpython-on-raspberrypi-linux |website=Adafruit Learning System |publisher=[[Adafruit Industries]] Industries |accessdate=17 July 2024}}</ref>

===Modules (Libraries)===

Adafruit has fostered a community which has contributed software libraries for more than 488 sensors and drivers.<ref>{{Cite web |title = Python on Microcontrollers Newsletter |url = 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/ |access-date = 17 July 2024}}</ref><ref>{{Cite web |title = CircuitPython Libraries |url = https://circuitpython.org/libraries |access-date = 17 July 2024}}</ref>


== References ==
== References ==
Line 43: Line 70:
[[Category:Microcontroller software]]
[[Category:Microcontroller software]]
[[Category:Python (programming language)]]
[[Category:Python (programming language)]]
[[Category:Free software programmed in C]]
[[Category:Software using the MIT license]]




{{Software-stub}}
{{prog-lang-stub}}

Latest revision as of 19:18, 17 July 2024

CircuitPython
Original author(s)Adafruit Industries
Initial releaseJuly 19, 2017; 7 years ago (2017-07-19)[1]
Stable release
9.1.1[2] Edit this on Wikidata / 22 July 2024; 52 days ago (22 July 2024)
Repositoryhttps://github.com/adafruit/circuitpython
Written inC[3]
PlatformSupported microcontrollers and single-board computers
TypPython implementation
LicenseMIT license[4]
Websitecircuitpython.org

CircuitPython[5] 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.[3] 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.[6]

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

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

Usage

[edit]

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.[11][better source needed] Developer Chris Young has ported his infrared transmit-and-receive software to CircuitPython to provide interactivity and to aid those with accessibility issues.[12]

Gemeinschaft

[edit]

The user community support includes a Discord chat room and product support forums.[13] A Twitter account dedicated to CircuitPython news was established in 2018.[14] 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.[15] A Reddit subreddit, r/CircuitPython, provides news on CircuitPython and related news and projects and has about 4,300 members.[16]

Hardware support

[edit]

The version 9.1.0 supports a range of architectures, 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
  • 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

[edit]

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)

[edit]

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

References

[edit]
  1. ^ Shawcroft, Scott (19 July 2017). "CircuitPython 1.0.0!". Adafruit Blog. Adafruit Industries. Retrieved 1 May 2018.
  2. ^ "Release 9.1.1". 22 July 2024. Retrieved 20 August 2024.
  3. ^ a b "adafruit/circuitpython". GitHub. Adafruit Industries. Retrieved 2 May 2018.
  4. ^ George, Damien P. (4 May 2014). "circuitpython/LICENSE". GitHub. Retrieved 1 May 2018.
  5. ^ "CircuitPython is an education friendly open-source derivative of MicroPython". GitHub. Retrieved 30 April 2018.
  6. ^ "CircuitPython". Read the Docs. Adafruit Industries. Retrieved 1 May 2018.
  7. ^ George, Damien (20 May 2016). "Damien P. George". Damien P. George. Retrieved 1 May 2018.
  8. ^ "Adafruit CircuitPython". MicroPython Forum. MicroPython.org. Retrieved 2 May 2018.
  9. ^ Lewis, James (14 February 2018). "Circuit Python adds Python to Microcontrollers". The Bald Engineer. Retrieved 2 May 2018.
  10. ^ Ganne, Simon. "Can I use circuitPython code on my raspberry?". Element 14 Community. Element 14.
  11. ^ Dopieralski, Radomir. "CircuitPython LAMEBOY". BitBucket. BitBucket. Retrieved 2 May 2018.
  12. ^ Young, Chris (6 June 2018). "Announcing IRLibCP — a Circuit Python Module for Infrared Transmitting and Receiving". CY's Tech Talk. Chris Young. Retrieved 2 May 2018.
  13. ^ "Adafruit CircuitPython and MicroPython". Adafruit Support Forums. Adafruit Industries. Retrieved 1 May 2018.
  14. ^ "CircuitPython". Twitter. Adfafruit Industries. Retrieved 1 May 2018.
  15. ^ "The Python on Microcontrollers Newsletter". Adafruit Daily. Adafruit Industries. Retrieved 17 July 2024.
  16. ^ "r/CircuitPython". Reddit.com. Adafruit Industries. Retrieved 17 July 2024.
  17. ^ "CircuitPython 9.1.0". GitHub. 17 July 2024.
  18. ^ "Why are we dropping support for ESP8266?". Adafruit.com. Adafruit Industries. Retrieved 15 April 2019.
  19. ^ "Blinka". CircuitPython. Adafruit Industries. Retrieved 17 July 2024.
  20. ^ "Blinka". CircuitPython. Adafruit Industries. Retrieved 17 July 2024.
  21. ^ "CircuitPython Libraries on Linux and Raspberry Pi". Adafruit Learning System. Adafruit Industries Industries. Retrieved 17 July 2024.
  22. ^ "Python on Microcontrollers Newsletter". Retrieved 17 July 2024.
  23. ^ "CircuitPython Libraries". Retrieved 17 July 2024.
[edit]