CircuitPython for Raspberry Pi and MCUs


Genuine cross-platform programming still does not work perfectly – even with CircuitPython, partly because of the lack of ports for individual libraries and partly because every platform works differently when you get into the details. However, porting overhead is reduced in all cases. If you look at the example in this article, you only need to change the way you define the button, and then the program will also run on the Trinket M0.

The biggest advantage of CircuitPython for the Raspberry Pi is easy access to many hardware components, regardless of whether you adopt the simpler programming model. Prototyping for MCUs is also often easier on the Raspberry Pi than directly on the corresponding hardware. Porting existing Python libraries is also far easier, because CircuitPython provides a stable API for accessing the classic I2C and SPI bus systems.

Programming fun is also crucial, though, and it is here that CircuitPython makes sure to lower the obstacles to getting started on a growing number of platforms.

The Author

Bernhard Bablok works at Allianz Technology SE as an SAP HR developer. When he's not listening to music, cycling or walking, he deals with topics related to Linux, programming and small computers. He can be reached at

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Web Serial API

    Upgrade your computer with LEDs, buttons, or sensors to control a microcontroller board over USB from your web browser.

  • Gesture-Controlled Book

    Have you found yourself following instructions on a device for repairing equipment or been half-way through a recipe, up to your elbows in grime or ingredients, then needed to turn or scroll down a page? Wouldn't you rather your Raspberry Pi do the honors?

  • Bluetooth LE

    Bluetooth Low Energy is ideal for networking battery-powered sensors. We show you how to use it on the Raspberry Pi.

  • Pico Sleep Mode

    The Raspberry Pi Pico's high-performance chip is trimmed for I/O and does not try to save power. However, a few tricks in battery mode can keep it running longer.

  • Adafruit PyPortal

    Unlike other displays for the Raspberry Pi, Adafruit's PyPortal touchscreen provides an autonomous environment, including a microprocessor, sound output, and a WiFi connection.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More