Mu Python Editor

We will be using the open-source Mu Python editor to edit and debug CircuitPython programs. This is a beginner-friendly solution for editing Python code and interacting with an embedded system over USB. It isn’t the only way to provide these capabilities, but it the system supported by the course.

Installation Notes

Installation packages are available for Windows, macOS, or Linux (as a pip3 install). For Windows and macOS I recommend the self-contained installer. For Fall 2023 we will be using current recommended version 1.2.0.

  1. On the first run, the application will download a number of additional packages.

  2. At the “Select Mode” dialog, please choose CircuitPython. (This can be easily switched at any time.)

Usage Notes

The editor looks for the CircuitPython device as a USB data drive. The “Load” and “Save” functionality will then work with code directly in the internal device memory. Saving the code will also restart the program.

The CircuitPython text console can be accessed via the “Serial” button. It is called REPL, which stands for “Read-Eval-Print-Loop”: once activated, the CircuitPython interpreter will accept single-line expressions, evaluate them, and print the result. This is a very useful way for starting short programs, testing individual code expressions, and exploring library functions.

References