ICYMI (In case you missed it) – Yesterday’s Python on Microcontrollers Newsletter from AdafruitDaily.com went out.
If you missed it, subscribe now! – You’ll get one terrific newsletter each Tuesday (before this post). Over 7,890 subscribers worldwide!
The next newsletter goes out in a week and being subscribed the best way to keep up with all things Python for hardware. No spam, no selling lists, leave any time. On with the show:
It’s here! The latest Python for Microcontrollers newsletter is brought you by the community! We’re on Discord, Twitter, and for past newsletters – view them all here. If you’re reading this on the web, subscribe here. Here’s what you missed:
Hi everyone! Here’s the latest Python for Microcontrollers newsletter, brought you by the community! We’re on Discord, Twitter, and for past newsletters – view them all here. If you’re reading this on the web, subscribe here. Let’s go:
CircuitPython powered protest signs
These panels are normally used to make video walls. Here in New York, we see them on the sides of buses and bus stops to display animations or short video clips. You can make them portable and informative.
Check out the guide RGB LED Matrices with CircuitPython and the code is on GitHub. Join Adafruit’s anti-racist efforts to end police brutality, reform the criminal justice system, and dismantle the many other forms of systemic racism at work in this country – adafruit.com/blacklivesmatter
Real Python interviews CircuitPythonista Kattni Rembor
On Real Python this week, Ricky White interviews Kattni Rembor, creative engineer at Adafruit Industries. Kattni’s role is varied, as she covers embedded software, hardware design, technical writing, and community leadership.
They talk about Kattni’s work developing CircuitPython and the role mentorship has played in her career to date. She also shares her advice for anyone looking to start their first hardware project using CircuitPython – Real Python.
CircuitPython Deep Dive Stream with Scott Shawcroft
This week, Scott streams his work on an ESP32-S2 and voting – YouTube.
You can see the latest video and past videos on the Adafruit YouTube channel under the Deep Dive playlist – YouTube.
Scott is also author of the CircuitPython on GameBoy cartridge. If you wish to see, the design is on OSHpark. (It isn’t currently reliable enough to sell.)
Adafruit is shipping orders as soon as possible, given NYC on-site staffing and safety.
Note: there may be a number of out of stock items as manufacturing gears back up. Adafruit suggests if an item is out of stock and needed, searching at resellers may yield results. In the US, Digi-Key is suggested.
The colorful Nanoleaf sculpture
Geek Mom Projects has made a DIY “Nanoleaf” sculpture. Triangle PCBs use side-emitting LEDs which diffuse into a translucent acrylic layer. It’s free standing and modular. It is assembled by screwing smaller PCB connectors to the back of adjoining boards. On the back, a system of spring connectors and pads transmits signal and power. A thin buffer layer of clear acrylic keeps the spring connectors from getting crushed. It is all powered by an Adafruit ItsyBitsy M4 Express running CircuitPython – Twitter.
News from around the web!
The sparkline class provides a scrolling line graph, where any values added to sparkline using
add_value are plotted. Kevin Matocha created a sparkline example for CircuitPython and displayio with inspiration from a Hackaday article – Twitter and GitHub.
A pool temperature monitor using an Adafruit CLUE with a Kitronik Zip Halo HD. The LEDs change from red to blue when the temperature drops below 69.5°F and the LCD also displays the temperature – Twitter.
Shift Register Out with CircuitPython and Arduino – YouTube.
An Adafruit Feather M0 and VEML6075 ultraviolet light sensor, an example in CircuitPython – Learn MicroPython.
An interactive choose your own adventure game using a Raspberry Pi, a thermal printer and some controls with CircuitPython – Twitter.
Runtime Class Modification – only using library features needed, saving RAM depending on the application – Hyperlink Your Heart.
MiniPB is a Mini Protobuf library in pure Python and it’s small enough to run in MicroPython – GitHub.
A MicroPython plugin for PyCharm which auto-detects connected MicroPython devices, uses the nearest Sources Root as the device root for flashing files, ignore .git, .idea while flashing – Twitter and JetBrains.
Micropython tutorial: Networking basics on the M5Stack WiFi Scanner – YouTube.
Glances – a cross platform, Python powered system monitoring tool that packs lots of data into a small package – bigl.es.
PyDev of the Week: Dong-hee Na on Mouse vs Python
#ICYDNCI What was the most popular, most clicked link, in last week’s newsletter? Summer of Making – Hack Club – GitHub is sponsoring $50k worth of hardware grants for Adafruit hardware!
Made with Mu
Why Mu? Mu tries to make it as easy as possible to get started with programming but aims to help you graduate to “real” development tools soon after. Everything in Mu is the “real thing” but presented in as simple and obvious way possible. It’s like the toddling stage in learning to walk: you’re finding your feet and once you’re confident, you should move on and explore! Put simply, Mu aims to foster autonomy. Try out Mu today! – codewith.mu
New Boards Supported by CircuitPython
The number of supported microcontrollers and Single Board Computers (SBC) grows every week. This section outlines which boards have been included in CircuitPython or added to CircuitPython.org.
This week we had 2 new boards added!
Looking for adding a new board to CircuitPython? It’s highly encouraged! Adafruit has four guides to help you do so:
- How to Add a New Board to CircuitPython
- How to add a New Board to the circuitpython.org website
- Adding a Single Board Computer to PlatformDetect for Blinka
- Adding a Single Board Computer to Blinka
New Learn Guides!
CircuitPython support for hardware continues to grow. We are adding support for new sensors and breakouts all the time, as well as improving on the drivers we already have. As we add more libraries and update current ones, you can keep up with all the changes right here!
If you’d like to contribute, CircuitPython libraries are a great place to start. Have an idea for a new driver? File an issue on CircuitPython! Have you written a library you’d like to make available? Submit it to the CircuitPython Community Bundle. Interested in helping with current libraries? Check out the CircuitPython.org Contributing page. We’ve included open pull requests and issues from the libraries, and details about repo-level issues that need to be addressed. We have a guide on contributing to CircuitPython with Git and Github if you need help getting started. You can also find us in the #circuitpython channel on the Adafruit Discord.
You can check out this list of all the Adafruit CircuitPython libraries and drivers available.
The current number of CircuitPython libraries is 257!
Here’s this week’s new CircuitPython libraries:
Here’s this week’s updated CircuitPython libraries:
PyPI Download Stats!
We’ve written a special library called Adafruit Blinka that makes it possible to use CircuitPython Libraries on Raspberry Pi and other compatible single-board computers. Adafruit Blinka and all the CircuitPython libraries have been deployed to PyPI for super simple installation on Linux! Here are the top 10 CircuitPython libraries downloaded from PyPI in the last week, including the total downloads for those libraries:
Keep checking back for more updated download stats coming soon!
What’s the team up to this week?
What is the team up to this week? Let’s check in!
With the work on the ICM20948 library completed, I moved on to finishing up the previously started tester code. Testers are the final arbiter of a board’s fitness to be sold, so the tester code is where we make sure that we’ve tested all of the hardware on the breakout board. We can fix libraries later if we’ve missed something or haven’t enabled a feature, however once the hardware ships to customers, that’s how it’s going to be for as long as they own it. Testers, and the code that powers them, are responsible for catching any glitches in manufacturing that, while rare, do occur. Making sure the tester code is right is in some ways more important than the library itself.
After finishing work on the ICM20948, I shifted to adding support for the LSP22 pressure sensor to the LPS2X library. The LPS22 is very similar to the LPS25 but not identical, so the libraries are able to share some but not all of the code. Ladyada had previously refactored the Adafruit_LPS2X Arduino library to add the LPS22HB, so my task was to do the same for the Adafruit_CircuitPython_LPS2X library. This refactor is a good example of a fundamental technique of object oriented programming, subclasses and superclasses. The base class LPS2X takes up the bulk of the library and includes all of the code that is common to both sensors. The LPS22 and LPS25 subclasses then inherit from LPS2X and then make small but meaningful changes to allow it to fit their particular requirements.
The end result is that rather than repeating the process of writing code that fulfills the common needs of both sensors, I am able to write it once and share it between both sensors. This idea is often called Don’t repeat yourself or DRY and in addition to reducing the amount of redundant code, it also centralizes the common code which makes it easier to fix or add features that are common across different uses.
I’m continuing the re-implementation of CircuitPython _bleio on host computers using the bleak Python library. I’m using the Heart Rate Monitor library as a test, and had to implement most of _bleio to get even that simple library to work. I had to make some changes to the base adafruit_ble library to accommodate Python on the host machines, and I’m testing now.
On the STM32F405 Feather, I have finished SDIO read and write code. The performance is better than SPI, especially when you are moving more data around. However, even just writing a log file in text, you can log over 1000 lines per second! This is on a “fresh”, class-4 4GB SD card, I’m not sure how performance changes as the card fills up.
This code is in an open pull request on GitHub, so if you are comfortable building CircuitPython from source you can give it a try today.
Next we want to bring SDIO code to the SAMD51. However, all the existing Adafruit boards use SPI. Hopefully this “breakout”, made from a micro SD adapter, will let me get the prototype code working:
While taking a break from SD cards, I returned to a problem that had been reported but never addressed: When using AudioMixer, if voice was not playing anything, the sounds from other voices was distorted. I also discovered a reason for pops when starting/stopping playback on voice, with the same root cause. These bugfixes are now in the latest master branch, and should be a part of 5.4.0 when it is released.
This week I started the AHTx0 CircuitPython driver, but due to timing, finalising that was handed back to Ladyada. Instead, I completed the AHT20 product guide. The AHT20 is a low-cost temperature and humidity sensor on a breakout that includes STEMMA QT connectors so you can get started quickly without soldering. The guide covers pinouts, Arduino usage, CircuitPython usage and downloads related to board including schematic, Fritzing object, EagleCAD files, and data sheet. The board will be in the Adafruit shop soon, so if you’re looking for a lower cost alternative for sending temperature and humidity, keep an eye out for that.
This week had a couple of major bugs come up across the STM32 and i.MX, so I’ve been hopping between the two projects as issues emerge. My big project of the last few days has been revisiting the clock management of the STM32s, to both fix some low-power related Real Time Clock (RTC) setup issues that were causing crashes across several dev boards, but also to make it a bit more comprehensive and maintainable. It’s been useful to learn about some of the features I’ve been taking for granted, and should allow new STM32 boards to enable more low power customization.
I’ve also wrapped up my i.MX testing on the 1010, just in time to get some new reset issues on the 1060 series. I’ve been doing my best to get quick hotfixes in and then following up with more comprehensive reworks later, so boards don’t stay out of commission too long. I’m hoping my i.MX Feather will arrive to complement my Teensy 4.0 soon, so I can have a wider range of easily debugged chips to test with.
This past week I was working on catching up with some of my smaller projects. One of the projects that I really enjoyed working on was writing up a couple of demos for an eInk bonnet. Since I didn’t actually have the eInk bonnet, I assembled one using the Adafruit Perma-Proto HAT for the Raspberry Pi along with an eInk breakout and a few passive components that I had on hand.
One of the demos I worked on went out and fetched weather data and displayed it on the eInk. This was a little challenging in that using too small of fonts would result in reduced readability, so I needed to experiment with font size, boldness, and the overall layout and it came together nicely. The code is based on the PyPortal weather code, but uses the meteocons font, which was inspired by Dan Cogliano, to display the weather image. So there’s actually no graphics involved in the traditional sense.
Another project that I worked on was updating the WebSerial 3D viewer that I had built a few months back in order to display calibration information for the BNO055. The cool part of this is that the calibration window will automatically appear only when calibration information is sent, so using the page with a board such as the CLUE will still look like it did before. I wrote up a guide page for that as well, which can be found inside the Adafruit BNO055 guide.
This past week I finished up busio.I2C on the ESP32-S2. Thanks to MarkOlsson for pointing out a problem with ACK/NAK that got a sensor working. Once that was done, I added pin validation and pull up checking. Next up is UART and SPI. I’ll also be doing a new beta release shortly.
FlaskCon is a community driven Flask event being held July 4th and 5th. It is intended for speakers and attendees all over the world to participate in technical and evangelical sessions related to Flask. Flask is a micro web framework written in Python – Event and Call for Papers.
EuroPython 2020 this year will be an online conference from July 23-26. The schedule is now available – Website.
Attending the conference days will require a ticket, participating in the sprint days will be free – EuroPython.
PyCon AU has announced they are holding PyConline AU, an online event, in August 2020 – pycon.org.au.
PyCon India 2020: the premier conference in India on using and developing the Python programming language. Held online October 3-5, 2020. A call for proposals is now open through August 14, 2020. – Website and Twitter
Send Your Events In
As for other events, with the COVID pandemic, most in-person events are postponed or cancelled. If you know of virtual events or events that may occur in the future, please let us know on Discord or on Twitter with hashtag #CircuitPython.
20200605 is the latest CircuitPython library bundle.
Call for help – Translating CircuitPython is now easier than ever!
One important feature of CircuitPython is translated control and error messages.
With the help of fellow open source project Weblate, we’re making it even easier to add or improve translations.
Sign in with an existing account such as Github, Google or Facebook and start contributing through a simple web interface. No forks or pull requests needed!
As always, if you run into trouble join us on Discord, we’re here to help.
jobs.adafruit.com – Find a dream job, find great candidates!
jobs.adafruit.com has returned and folks are posting their skills (including CircuitPython) and companies are looking for talented makers to join their companies – from Digi-Key, to Hackaday, Microcenter, Raspberry Pi and more.
The Adafruit Discord community, where we do all our CircuitPython development in the open, reached over 20,689 humans, thank you! Adafruit believes Discord offers a unique way for CircuitPython folks to connect. Join today at https://adafru.it/discord.
ICYMI – In case you missed it
The wonderful world of Python on hardware! This is our first video-newsletter-podcast that we’ve started! The news comes from the Python community, Discord, Adafruit communities and more. It’s part of the weekly newsletter, then we have a segment on ASK an ENGINEER and this is the video slice from that! The complete Python on Hardware weekly videocast playlist is here.
Weekly community chat on Adafruit Discord server CircuitPython channel – Audio / Podcast edition – Audio from the Discord chat space for CircuitPython, meetings are usually Mondays at 2pm ET, this is the audio version on iTunes, Pocket Casts, Spotify, and XML feed.
And lastly, we are working up a one-spot destination for all things podcast-able here – podcasts.adafruit.com
Codecademy “Learn Hardware Programming with CircuitPython”
Codecademy, an online interactive learning platform used by more than 45 million people, has teamed up with the leading manufacturer in STEAM electronics, Adafruit Industries, to create a coding course, “Learn Hardware Programming with CircuitPython”. The course is now available in the Codecademy catalog.
Python is a highly versatile, easy to learn programming language that a wide range of people, from visual effects artists in Hollywood to mission control at NASA, use to quickly solve problems. But you don’t need to be a rocket scientist to accomplish amazing things with it. This new course introduces programmers to Python by way of a microcontroller — CircuitPython — which is a Python-based programming language optimized for use on hardware.
CircuitPython’s hardware-ready design makes it easier than ever to program a variety of single-board computers, and this course gets you from no experience to working prototype faster than ever before. Codecademy’s interactive learning environment, combined with Adafruit’s highly rated Circuit Playground Express, present aspiring hardware hackers with a never-before-seen opportunity to learn hardware programming seamlessly online.
Whether for those who are new to programming, or for those who want to expand their skill set to include physical computing, this course will have students getting familiar with Python and creating incredible projects along the way. By the end, students will have built their own bike lights, drum machine, and even a moisture detector that can tell when it’s time to water a plant.
Codecademy has helped more than 45 million people around the world upgrade their careers with technology skills. The company’s online interactive learning platform is widely recognized for providing an accessible, flexible, and engaging experience for beginners and experienced programmers alike. Codecademy has raised a total of $43 million from investors including Union Square Ventures, Kleiner Perkins, Index Ventures, Thrive Capital, Naspers, Yuri Milner and Richard Branson, most recently raising its $30 million Series C in July 2016.
The CircuitPython Weekly Newsletter is a CircuitPython community-run newsletter emailed every Tuesday. The complete archives are here. It highlights the latest CircuitPython related news from around the web including Python and MicroPython developments. To contribute, edit next week’s draft on GitHub and submit a pull request with the changes. Join our Discord or post to the forum for any further questions.