26 dpaonthenet.net
For embedded systems that face tight-
er resource and interface constraints, an
optimised version for microcontrollers,
called MicroPython, has become pop-
ular. So much so that the open source
community has been adapting Micro-
Python to specific microcontrollers and
dev boards.
The reason for Python
The original Arduino dev board and its
many successors have been very popular
microcontroller dev boards for maker,
hobby, and student projects, as well as
for embedded prototypes. However, the
Arduino IDE and programming language
are based on C++, a powerful but complex
compiled language with an odd-looking
syntax and rigid punctuation rules.
Python is a newer programming lan-
guage. It is an interpreted, interactive,
object-oriented language that combines
programming power with a very clear
syntax. It is known for its writability and
readability, as well as for its simpler syn-
tax. These characteristics combine to re-
duce the number of programming errors
and make code reuse easier.
One drawback is that Python was de-
signed to run on PCs and larger machines
with plenty of RAM, large amounts of mass
storage, and a comprehensive user inter-
face. However, a lean, efficient implemen-
tation of the Python 3 programming lan-
guage, called MicroPython, has emerged.
Recognising MicroPython’s promise as
an embedded programming language,
the open source community has been
adapting it to certain microcontrollers
and dev boards to support serious
microcontroller development. For ex-
ample, Adafruit has developed its own
flavour of MicroPython, called CircuitPy-
thon which is designed to simplify ex-
perimentation and learning to program
on low-cost microcontroller boards.
Differences between C++
and Python
C++ is an extension of the older C
language with object-oriented extensions.
The basics of CircuitPython
for rapid microcontroller-based
prototyping and development
W
hile the Python language has made
programming more accessible, it
was designed to run on PCs and other
machines with plenty of processing,
memory, and peripheral resources.
Feature: Rapid microcontroller-based prototyping
Figure 1: Adafruit’s 3333 Circuit Playground Express features ten
addressable, controllable RGB LEDs. (Image source: Adafruit)