CircuitPython vs MicroPython: Key Differences

Updated 16 July 2018

Have you ever wanted to program your microcontrollers with Python instead of Arduino? MicroPython and CircuitPython bring the ease of Python to microcontrollers by adding hardware support! In MicroPython, Python is largely unchanged other than the added functionality to interface with hardware.

CircuitPython is a derivative of MicroPython that changes a few things to make the language easier to learn and use. CircuitPython is created and maintained by Adafruit. It’s an education friendly open-source derivative of MicroPython. CircuitPython is supported on Adafruit’s educational development boards. Updates to MicroPython are rolled out to CircuitPython as well.

So what in CircuitPython is different then MicroPython? Lets break down the key differences. If you want a comprehensive list, the Adafruit CircuitPython Documentation has a full list of differences between CircuitPython and MicroPython.


Supported Boards

The most important difference between CircuitPython and MicroPython is that CircuitPython includes a port for Atmel SAMD21 (usually called M0), and only supports Atmel SAMD21 and ESP8266 ports. CircuitPython is designed by Adafruit for Adafruit boards, and is not supported for anything else. The following list are the differences in CircuitPython that will be most relevant to the average user:

Behavior

  • The order that files are run, and the state that is shared between them. CircuitPython makes each files role clearer and makes each file independent. 
  • boot.py or settings.py runs only once on start up before USB is initialized.
  • Code.py (or main.py) is run after every reload until it finishes. After it is done running, the vm and hardware is reinitialized. This means you cannot read state from “code.py” in the REPL.
  • After code.py, you can enter REPL by pressing any key. It does not share state with code.py

API

Unified hardware APIs: audioio, analogio, busio, pulseio, touchio, microcontroller, board, bitbangio.

Modules

Tick count is available as time.monotonic()

If you are new to both CircuitPython and MicroPython, there are no real limitations to either that will stop you from achieving your project goals. If you are learning to code or are an educator teaching others. CircuitPython is designed with ease of use for beginners in mind, and is easer to teach and learn. If you want to learn more about CircuitPython, check out our  Introduction to CircuitPython Tutorial for the Adafruit Circuit Playground Express! If you want to learn about some microcontrollers that use MicroPython, check out our Pycom Tutorials.

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.