This post is a wishlist for CircuitPython in 2025. Each year Adafruit asks the community to contribute their thoughts or requests for the open source microcontroller language as outlined on the Adafruit blog.
In 2025 I would like a library for working with vectors, similar to that of p5.js Vector.
Early this year I spent some time re-visiting the MatrixPortal M4, specifically trying to reproduce some of the examples found in the excellent book Nature of Code by Daniel Shiffman on two 64×32 RGB LED panels.
This latest book uses JavaScript, and the p5.js library to simulate natural systems. A rewrite of the original book using Processing. I had some success getting the first few examples to work with DisplayIO and CircuitPython.
I was able to do some of the basic matrix addition / subtraction / multiplication etc. with custom functions but where I started to run in to some difficulty was with some of p5.Vector handy methods: limit() – Limits a vector’s magnitude to a maximum value. heading() – Calculates the angle a 2D vector makes with the positive x-axis. rotate() – Rotates a 2D vector by an angle without changing its magnitude.
Looking back this year at some of my CircuitPython projects, I definitely levelled up on displayio and enjoyed the Live streams of FoamyGuy, JP’s workshop, and of course Adafruit’s Show & Tell. I appreciate the contributions from all the Adafruit developers as well as the community.
My commitment this year will be to “Use what you have” and hopefully contribute if I can.
A fun little challenge to myself this week was putting together these HTML input range type sliders to control the color of an LED. Each color channel change triggers an update to read the value, convert it to a hex code (eg. #FF0000), update the output element value, and finally update the color picker swatch. The color input can also be used as a standard color picker. When a color is selected and the user clicks off the picker, the three sliders get updated appropriately.
Now, input range type sliders have been notoriously difficult to style in the past and I’ll admit I’m running this on Chrome only for myself. As these sliders in Chrome are normally blue I only needed to style two simply with accent-color: red;accent-color: green;
On my local network I’m running a webserver on a tiny mircocontroller. When a client posts the form data, the LED on the ESP32-S3 changes color. That color persists and any new connections open the page with the latest assiged color.
[EDIT: The slider broke after a browser update. Turns out setting height is now required. The final CSS is: input[type="range"] { writing-mode: vertical-lr; direction: rtl; appearance: slider-vertical; height: 6rem; vertical-align: bottom; margin: 1rem 0rem;}]
Matter is the name of the smart home standard that promises to bridge IOT devices and different home eco-systems. Amazon Alexa, Google Home, Apple Homekit, Samsung SmartThings, etc.
To prevent 6+ flavours of smart lightbulbs working with 6+ different apps, a standard needed to be found.
When I first heard about the Matter standard I thought it made sense and decided to test it out. In January 2024 Arduino announced a partnership with SiLabs to produce a Matter enabled board. It uses the same chip as Sparkfun’s Thing Plus Matter – MGM240P – Consider me “on-board”. I bought the Sparkfun board.
I <3 Sparkfun and their documentation and videos are excellent. However what followed was all new experiences for me, including using SiLabs IDE to Flash and program the device. What, no Arduino or MicroPython? (Turns out there is now an Arduino example.) I eventually kind-of figured out the SiLabs “Simplicy Studio 5” development environment. https://learn.sparkfun.com/tutorials/connecting-thing-plus-matter-to-google-nest-hub
My idea was that Matter was an open standard and works across home ecosystems. However what followed was Vendor IDs and Product IDs authentication, command line conjuring, and QR code scanning.
Measure CO2, temperature, humidity and send that data to the cloud, while displaying results on an 2.9″ e-ink display.
My first choice was to use the display vertically. It feels a bit less like a price tag in this orientation.
This past August 18th marked CircuitPython day, a celebration of Python on Microcontrollers. CircuitPython is an off-shoot of MicroPython maintained by Adafruit which aims to ease the use Python on constrained devices with limited RAM and Flash memory, reduced CPU. AKA Microcontrollers.
Beside indoor sensing of CO2, temperature, and humidity I’m also using the ESP32-S2 with Adafruit Requests library to fetch an XML file hourly from my local weather service for current outdoor temperature and humidity. Some challenges include when this xml feed changes due to weather events and warnings. I’ve included lots of try:except: blocks for each step of the Requests, Socket pool, Parsing to find where it was sometimes failing.
This BMP280 library also contains code I have happily contributed to which helps set the altitude of the sensor. Changes in pressure are registered as atmospheric rather than altitude.
E-ink is awesome for it’s low power. Combined with the ESP32-S2 deep-sleep capabilities I’ve managed to get hourly updates for days on a tiny 150mha battery.
All of the data is shared hourly to Adafruit IO. A cloud service which provides dashboards, alerts, events, and recording of historical data.
The majority of work was laying out the e-ink display and data labels using the CircuitPython displayio library. Two separate fonts are used separating Inside vs Outside data.
One cool feature is using a spritesheet for the temperature, humidity, and battery icons. The data depends which icon gets shown:
As a serious microcontroller user or single board computer enthusiast, I have the choice to program with Arduino, C++, Python with Raspberry Pi, CircuitPython, JS etc. More often than not given this choice I choose CircuitPython.
Here is why I personally prefer it: 1) Mountable drive with code.py file – Plug in the device and it mounts like a thumbdrive on Windows, Mac, or Linux. Any text editor can immediately read and change the code running on the board. Not something that is immediate with Arduino.
2) The REPL – Or Read, Evaluate, Print, Loop on the command line. This allows you to test and run small bits of code without committing permanent changes.
3) Circup – A command line package manager that manages and updates libraries found on any board plugged into the computer.
4) The community – So many great people contributing and sharing in a very welcoming environment.
I have a couple ideas for a case or mount but happy so far and I wanted to share for CircuitPython day.