Python on Hardware

9/20/2018
| By Maker.io Staff

A whole generation of programmers have now grown up with the web, where JavaScript is the de facto language for creating dynamic user interfaces and managing databases. Alongside them is another, even larger, group who have made Python the de facto language of science, engineering, data analysis, and most recently machine learning. The emerging future communities we're seeing are being built not around specific chipsets or boards, but around languages. These modern languages are high level in that they are more than just a syntax-tree and compiler. They are fully-featured development environments that come with comprehensive libraries, code examples and support networks High-level language support is fundamentally disruptive to the way we currently build hardware.

Most people, and most makers, want to solve a problem. Maybe they're sending sensor data to the internet for an IoT device, or listening for radio signals that will move a motorized robot. While, for some, the specifications of the chipset or board really matter - the number of timers, the specs of the ADC controller - the across-the-board increases in microcontroller/microcomputer power and capabilities means that, often times, the specs don't vary that much. In a move that mirrors the changes we saw in the desktop and laptop computer market, our microcontroller hardware has become good enough that we now don't have to worry about the underlying architectures and instead, we can focus on application engineering.

When it comes down to it, the next generation of high powered microcontrollers and microcomputers will be defined, not by their hardware, but by their user experience. UIs will be rich and complex, with TFTs and OLEDs (a single button and buzzer will not suffice). Connectivity is now a given, you must have a stack for managing Internet or Bluetooth. And with such complexity, we need higher level languages. The future of hardware is about accessibility, and we will be programming using an easily accessible, and widely known, high level language like Python.

CircuitPython

CircuitPython is Adafruit's branch of MicroPython designed to simplify experimentation and education on low-cost microcontrollers. It's fully interpreted, with the interpreter acting as your RTOS (of sorts). No compiler, linker or IDE required! Now you can code directly on the device itself. CircuitPython makes it easier than ever to get prototyping by requiring no up-front desktop software downloads - open up the embedded code.py text file in any text editor and type away.

It is great for beginners: With CircuitPython you can write clean and simple Python code to control hardware instead of having to use complex low-level languages like Arduino, C or C++. The simplicity of the Python programming language makes CircuitPython an excellent choice for beginners who are new to programming and hardware.

Experts love it too: skip the annoyances of long-compile cycles, pointers and memory management - get right to the programming you want to do. CircuitPython is also full-featured and supports all of Python's syntax (Python version 3.4) and implements some useful parts of the Python standard library so even seasoned Python veterans will find CircuitPython familiar and fun to use.

Adafruit's latest boards are the Metro, the Feather, and the ItsyBitsy (from largest to smallest). The Metro board features powerful Microchip Technologies SAMD51 microcontrollers with the ARM Cortex M4 core which includes hardware floating point support and DSP operations.

Running at 120 MHz and containing more RAM and Flash than prior boards, the new Adafruit boards are tailor-made for running CircuitPython quickly and effectively for taxing applications.

On the educational side, the Adafruit Circuit Playground Express provides the power of CircuitPython with the sensors and lights all on-board. It contains the features most requested from the educational community with ease of use and broad software compatibility.

The Adafruit Gemma M0, about the size of a U.S. quarter, is perfect for small wearables. The Trinket M0 is most often used in compact breadboard-friendly designs. Adafruit's Metro M0 Express provides shield-compatibility with the Arduino ecosystem. Finally, the Adafruit Feather M0 Express has dozens of companion boards which take advantage of the Feather system.