What's Circuit Python?
Circuit Python is a version of Micro Python which is Python optimized to run on micro-controllers. So, it’s Python for micro-controllers. The Python language is one of the fastest growing programming languages, due to its flexibility and ease to learn. Modern micro-controllers (MCs) with increased power enable Circuit Python to run interpreted rather than as firmware, similar to how computers run programs. This method allows greater flexibility and an easier overall experience. Arduino is a great platform because it has many libraries and a large community, Circuit Python is following this trend. There are also many devices that work with Circuit Python, Cricket, Micro-bit, Circuit Playground Express, Clue, Feather as examples.
Circuit Playground Express
Let’s take a quick look at the Circuit Playground Express (CPE). The CPE is a micro-controller board designed for learning Circuit Python. The CPE is produced and supported by Adafruit. It’s priced reasonably at about $25. It works with Make Code, Arduino, JavaScript and Circuit Python. It comes loaded with a suite of sensors. 2 buttons, slide switch, 10 Neopixels, light sensor, temperature sensor, motion sensor and microphone, as highlights. The board has more than enough to get started learning Circuit Python with microcontrollers.
Programming the Circuit Playground Express
The process of programming the CPE is very simple, you can use most text editors, however I suggest using Mu. Mu has a “mode” designed for working with Adafruit boards. Plug your CPE in and it will show up as a USB drive. You may have to set it up to run CP (circuitpython-quickstart) as it might be configured to run Make Code. After you write your code click the check button, if there are no formatting or syntax errors simply save your code directly to the CPE as “code.py”. That’s it the CPE should start running your code.
Example: Here the Neo-pixels will turn on in a “Tracer pattern”.
The Circuit Playground express and Circuit Python are a great way to learn Python and about micro-controllers. Circuit Python allows users already fluent with Python to quickly prototype with microcontrollers. I really enjoy working with this combination and encourage you to do the same. Check back soon, I will write a more in-depth guide to the CPE as I explore Python with it. I will also compare the CPE to the new Clue board. The Clue board shares the same footprint as the Microbit which makes it compatible with most available Microbit accessories. If you haven’t been to Adafruit’s website I really suggest you take a look Adafruit has plenty of example files to get you started.
Resources
- Adafruit Circuit Playground Express: https://www.adafruit.com/product/3333
- Starting with Circuit Python on CPE: https://learn.adafruit.com/adafruit-circuit-playground-express/circuitPython-quickstart
- Getting started with Mu: https://codewith.mu/en/tutorials/1.0/adafruit
- Adafruit write up about Circuit Python: https://learn.adafruit.com/welcome-to-circuitpython