Ask Your Question

Revision history [back]

CircuitPython workflow suggestions

Background: I am using CircuitPython, which is a fork of micropython. This version of Python runs on some microcontrollers, and is supported by AdaFruit. They also support the My Editor, which is another Python IDE. Instead, I use Wing Pro 7 for CircuitPython development.

The CircuitPython environment works by connecting the microcontroller over USB to the host, where Wing is running. The microcontroller shows up as a USB drive. I copy a file called code.py to this USB drive, and the microcontroller runs the program. It is also possible to open a terminal on the microcontroller. For example, I can run the command 'screen /dev/tty.usbmodem1421401' and this opens a terminal where I can access the REPL, or switch modes and get stdout from a running code.py.

What works so far: I can edit code.py with Wing, and I have configured the Build command to copy the file code.py to the microcontroller. This has the desired effect: the program runs on the microcontroller. I am able to remotely write microcontroller code in pure Python using WingIDE.

Improvement I am seeking: I get warnings 'Import not found' for all of the CircuitPython-specific modules. I would like to somehow tell Wing about these modules that are in the microcontroller's version of Python. The challenge is that this Python runs on a different architecture and some of the modules call compiled C code on the microcontroller. Is there a way to tell Wing about these modules?