View this email in your browser.
Hi everyone! It’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 slither thither:
A note from the editor – We’ll make it together
Phil and Ladyada here. We usually do the newsletter each week. This week are diverting all our attention to efforts in NYC and the world to help combat the COVID-19 outbreak. Thank you community for keeping us strong, and thank you Adafruit team for running the newsletter for now.
Adafruit was deemed an essential manufacturing, service and business in NYC by Executive Order 202.6. We have a blog post with an overview and things are changing quick, stay tuned for updates on everywhere Adafruit is on social media – Read more.
We are shipping a limited number of orders for health care professionals / urgent needs only. All other orders are being held for now.
Adafruit is a 100% woman-owned, loan-free, VC-free, profitable USA Manufacturing company. Please see our about page and press page to read about us. Our founder and lead engineer is Limor Fried, a MIT Electrical Engineer.
We have paused some operations in NYC due to COVID-19, we are paying all team members, contractors, and more.
There are no layoffs for 130+ Adafruit team members. Adafruit was deemed an essential service to distribute/make some PPE (Personal Protection Equipment) such as face shields, and manufacturer electronics for essential life-saving/preserving equipment and development, which is needed in New York and beyond.
Adafruit Industries, located at 150 Varick Street, New York, NY 10013 by Executive Order 202.6, “Essential Business” by New York State: https://esd.ny.gov/guidance-executive-order-2026
Adafruit provides the following services:
Medical equipment/instruments including:
Warehouse/distribution and fulfillment
Essential manufacturing including:
Essential health care operations including:
Medical supplies and equipment manufacturers and providers
We are maintaining some, but not all, business operations to assist in providing these valuable services to combat the COVID-19 outbreak.
If you are working on COVID-19 related efforts, we are shipping.
CircuitPython libraries are now using the latest Pylint and Black formatting!
Adafruit has completed updated every CircuitPython library to use the latest version of Pylint and implemented the Black Python formatter. Pylint is a tool for linting code. Linting is the process of checking your code for basic stylistic mistakes. It doesn’t verify that your code works, it simply checks that it looks as good as possible and is readable by others. Black is a really useful code formatting tool maintained by the Python Software Foundation. It reformats files to improve readability. When you contribute code to CircuitPython libraries, your code will be checked for both. You’ll be able to make any fixes at that point, but it’s much easier to set up Pylint and Black on your machine and run them locally.
We have a guide to help! The Improve Your Code with Pylint and Black guide was recently updated to include installation and usage of Black, as well as to reflect the update to the latest Pylint. You are no longer required to specify a particular version of Pylint or Python to be able to check your code locally. The process should be much simpler now. Check out the guide and you’ll be up and running in no time! – Adafruit
Espressif ESP32-S2 Sample Boards Shipping
Espressif Systems has shipped sample ESP32-S2 boards to companies ordering them for evaluation purposes. Adafruit is working to port TinyUSB for CircuitPython support. – Twitter
The OSHW Summit wrist badge gets USB programming support
Drew Fustini posts “I sense Blinka is excited to no longer be tethered to a j-link. Time to code some CircuitPython from the comfort of USB”. Drew was on this past Wednesday’s Show and Tell (video). – Twitter
MQTT in CircuitPython with Ethernet
The MQTT in CircuitPython guide has been updated to include setup instructions and code for use with Ethernet for CircuitPython.
So, you have a CircuitPython project and want to connect it to the internet? You may want to consider adding MQTT to your project. MQTT is an extremely popular and lightweight protocol which can connect your project to the internet and quickly process network events.
In this guide, you will set up your CircuitPython board with the necessary libraries, connect to the internet and connect your CircuitPython board to either a MQTT broker of your choice or the free Adafruit IO MQTT broker. We’ve included code-walkthrough and advanced usage sections to this guide so you can roll your own MiniMQTT project!
More: Updated Guide and Blog.
News from around the web!
Raspberry Pi Thermal-Visual Player combines the images from a Raspberry Pi camera and an Adafruit MLX90640 thermal camera on screen using CircuitPython. – Twitter and GitHub
Pigweed is a collection of embedded-targeted libraries. They are open source for 32-bit microcontroller development released by Google. They address the classic challenge in the embedded space of reducing the time from running git clone to having a binary executing on a device, setting up an entire suite of tools needed for non-trivial production embedded projects. – Google Blog and Source
CircuitPython work to interface an Adafruit CLUE board with the Elecfreaks Joystick:bits. – Twitter and Blog
David Glaude writes “Pimoroni famous Blinkt! is just a bunch of 8 APA-102 connected to GPIO 23 and 24. 4tronix map that to micro:bit pin 16 and 5. In Adafruit CircuitPython, APA-102 is named DotStar. Driving the Blinkt! from the Clue was done in a matter of minutes.” – Twitter
octopusLAB.cz posts that they have an ESP32 based ROBOT board which facilitates using robotics with MicroPython. Twitter, GitHub and Website
Building a Physical Microbit Neural Network – building a physical simple neural network in MicroPython . –Twitter and Medium
Using Python in R – Video and GitHub
A simple way to create a Python CLI app: An easy example of wrapping Machine Learning application to the command line interface – Medium
DS3 – a Python-based open-source system-level framework which enables run-time scheduling algorithm development, DTPM policy design, and rapid design space exploration for domain-specific SoCs. – Paper
Launch Control ia a fun 70’s industrial inspired “launch” control panel with a Yubikey key switch. If the Yubikey is authenticated as valid by Yubico servers and is recognized as enrolled on the device, it pulls a solenoid and allows the user to turn the Yubikey like a real key, engaging the system. It uses a Raspberry Pi with the CircuitPython Blinka library. – GitHub and YouTube
A pull request is pending to support CircuitPython on the Thunder pack board. The board includes an integrated battery, power management system, an STM32F11xx Arm microcontroller, USB bootloader, 4 high-power PWM outputs, and 12 GPIOs. – Project GitHub and CircuitPython PR
PyDev of the Week: Jessica Garson on Mouse vs Python
CircuitPython Weekly Meeting for March 23rd, 2020 on YouTube.
#ICYDNCI What was the most popular, most clicked link, in last week’s newsletter? title.
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
ulab (pronounced microlab) is a numpy-like Python number crunching library. It is coming to CircuitPython 5.1.0 alpha. More in the new Adafruit guide.
New Learn Guides!
Adafruit Bonsai Buckaroo from Kattni
Adafruit HTS221 – Temperature & Humidity Sensor from Bryan Siepert
Adding a Single Board Computer to PlatformDetect for Blinka from Melissa LeBlanc-Williams
Burning Fire Wizard Staff from Erin St. Blaine
MX MIDI Guitar from Noe and Pedro
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!
For the latest drivers, download the Adafruit CircuitPython Library Bundle.
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! 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. Feel free to contact Kattni (@kattni) with any questions.
You can check out this list of all the CircuitPython libraries and drivers available.
The current number of CircuitPython libraries is 221!
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 an eye out here for 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!
This week I’m working on the breakout for the DS1841 Temperature-Controlled, Non-Volatile I2C Logarithmic Resistor from Maxim. This chip is super cool. It’s intended purpose is to provide temperature compensated bias control for avalanche photodiodes (APDs) used in optical transceivers. They’re new to me, but apparently APDs are commonly used because they have a high sensitivity and wide bandwidth at the cost of being sensitive to temperature fluctuations. This chip can help with that! You can check out this app note if you want to learn a bit more about APDs.
While most of us don’t have a private fiber optic network with fussy APDs, the DS1841 has enough bells and whistles that I’m sure you’ll be able to find a use for it in a project. It’s basically an I2C controller potentiometer with a logarithmic curve, so you can use it in place of a mechanical log potentiometer to allow you to control it programmatically. Furthermore, the temperature compensation uses a LUT (look up table) to allow the user to adjust how the resistance varies according to temperature. You can, however, turn off the temperature based adjustment and use the LUT directly to give you the same control over the behavior of the resistance!
I’m looking forward to seeing what you all can do with this chip. While testing, I’ve got it hooked up in a simple voltage divider. You could do something similar to control all sorts of things. LEDs, DC/DC converters, Op-Amps, the possibilities are endless!
I’ve been able to connect via BLE with some inexpensive readily available cooking thermometers. The ones I have all identify as “iBBQ”. Someone on the great world wide web wrote up its BLE specs, and I was able to create a CircuitPython library quickly.
I’d never used adafruit.io for anything before, so I cooked up a quick demo which gets temperatures and battery status via BLE and sends it via an AirLift FeatherWing. I used the latest CircuitPython MQTT library which Brent R. released just yesterday. It worked great!
I’m also working on a CircuitPython library that implements all the services we provide for the Bluefruit Playground app. We have Arduino code for this, but haven’t implemented it in CircuitPython yet. When I finish, you’ll be able to both send and receive data for all the on-board sensors, buttons, and peripherals on the Circuit Playground Bluefruit and the CLUE boards.
Finally, I’m still debugging spurious writes to the SAMD51 internal flash – no breakthroughs yet, but I have some clues.
Together with PaintYourDragon, we are working on a new library for LED panels. Dragon is doing the heavy lifting, creating the low level code (and Arduino bindings); I’m adapting it to fit CircuitPython. In the future, CircuitPython will be able to drive displays like these, probably using the displayio module that is used for LCD and e-ink displays:
We are also working towards releasing version 5.1.0 of the core CircuitPython code, and I am doing more of the release-related tasks this time around. Two exciting additions are ulab, which I’ve talked about in other updates; and support for “f-strings”, a more modern and concise way to build strings than “%” or “.format()”. Both of these features are expected to be available on higher powered CircuitPython devices with SAMD51, nRF, and STM microcontrollers.
This week, we finished updating all the CircuitPython libraries to use the latest Pylint and implemented the Black Python formatter. This was a huge project – thanks to Dylan for all his hard work. We updated the Pylint guide to include Black and reference the latest version of Pylint. If you’re going to contribute code to a CircuitPython library, check out this guide for how to ensure your code is up to standards.
I’m currently working on the Bonsai Buckaroo guide. This guide will have all the details on the board, and examples for both the CLUE and the micro:bit. Keep an eye out for that coming soon!
This past week I have been working on a guide for adding a new Single Board Computer to PlatformDetect, which is the first part of adding a new Board to Blinka. You can check out the guide, which is available at https://learn.adafruit.com/adding-a-single-board-computer-to-platformdetect-for-blinka.
After finishing that guide, I started on the guide for the next part, which is adding a new board to Blinka. This is probably the most difficult guide I’ve written, due to the complexities of adding a new board and trying to explain it in an easy to understand way. Be sure to look out for the new Blinka guide coming soon.
In addition to the new guide, I will be applying a new look to the Web Bluetooth Dashboard that I had worked on a couple of weeks ago that one of our designers came up with. Be sure to look out for that as well.
This week I’ve continued adding low power support to the different chip families. SAMD51 and SAMD21 now work. The Spresense port is building but untested.
This week I’m working on STM32 support and hopefully starting iMX RT support after that. The trickiest bit is providing a higher resolution clock for PulseIn to use.
Once they are all preliminarily tested, I’ll put out a call for folks to test it. So, keep an eye out.
Lastly, on Saturday I streamed myself working on TinyLogicFriend, which is logic analyzer firmware built on top of TinyUSB. It will hook into Sigrok on the desktop side. There is also a recording of the stream.
The Python Software Foundation, organizers of PyCon US 2020, released a message March 20th, having made the difficult decision to cancel the event in light of the COVID-19 pandemic. They are still working on the situation, and those affected should read their announcement. They are looking to host PyCon US 2021 in Pittsburgh, Pennsylvania, USA. – PyCon Blog
CircuitPython’s stable release is 5.0.0. New to CircuitPython? Start with our Welcome to CircuitPython Guide.
20190321 is the latest CircuitPython library bundle.
v1.12 is the latest MicroPython release. Documentation for it is here.
3.8.2 is the latest Python release. The latest pre-release version is 3.9.0a4.
1640 Stars Like CircuitPython? Star it on GitHub!
Call for help – CircuitPython messaging to other languages!
We recently posted on the Adafruit blog about bringing CircuitPython messaging to other languages, one of the exciting features of CircuitPython 4 and later versions is translated control and error messages. Native language messages will help non-native English speakers understand what is happening in CircuitPython even though the Python keywords and APIs will still be in English. If you would like to help, please post to the main issue on GitHub and join us on Discord.
We made this graphic with translated text, we could use your help with that to make sure we got the text right, please check out the text in the image – if there is anything we did not get correct, please let us know. Dan sent me this handy site too.
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 17,220 humans, thank you! We’ve had a recent surge in members and we believe it is a place for everyone to come together. Join today! 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.
This video podcast is on iTunes, YouTube, IGTV (Instagram TV), and XML.
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.
Visit Codecademy to access the Learn Hardware Programming with CircuitPython course and Adafruit to purchase a Circuit Playground Express.
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.