Daily tips and tricks from the experts at Adafruit!
View this email in your browser

View this email in your browser.

Happy mid-December! 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.

Note: This issue has flashing images – if you are sensitive to such you may wish to print it out

Sony Publishes a Guide to CircuitPython on their Spresense Board

CircuitPython on Spresense Guide

Sony has just released a new getting started guide to help developers program their Spresense microcontroller board with CircuitPython.

Python developers will feel familiar with the way to program Spresense. After the initial set-up for Spresense, there is no need for any extra desktop development environment tools. Use your favorite text editor to start developing. The new getting started guide helps set up Spresense for CircuitPython in a matter of minutes in a step-by-step fashion. All CircuitPython libraries have example code to help you kick-start your programming.

Sony plans to continue expanding the guide with tutorials, featuring unique Spresense features and capabilities when using CircuitPython. You can get Spresense updates via Sony’s Developer World on TwitterSony Blog, Guide, and Developer Site.

Announcing the PSF Diversity and Inclusion Work Group

PSF Diversity and Inclusion Work Group

Expansion in the Python community has brought new challenges and opportunities to improve the global community. In order to further the PSF’s mission to ‘support and facilitate the growth of a diverse and international community of Python programmers’, the Python Software Foundation announced the launch of the Diversity and Inclusion Workgroup (D&I workgroup) – Python Blog

Piunora: Designing a Raspberry Pi Compute Module 4 Carrier and CircuitPython

Piunora

Deep Dive with Scott

Timon on Twitter posts a very different concept: Piunora. A carrier for the Raspberry Pi CM4 in an Adafruit Metro/
Arduino form-factor. It features full-size HDMI, USB-C (data+power), USB-A, M.2 (PCI-E), RGB LEDs, 6xADC, Button, camera connector and a Qwiic/Stemma QT connector – Twitter Thread.

I got the idea from Scott Shawcroft and at first thought it was a bit silly, but in reality this offers some major benefits compared to the standard RPI4 when we are looking at this from an electronics dev board perspective. This enables something really cool, and what I intend for this to be the primary application and that is CircuitPython by mounting the Pi as a USB gadget instead of a host device. So you can develop on the Pi like you would with a normal MCU dev board directly on your PC!

CircuitPython Deep Dive Stream with Scott Shawcroft

Deep Dive with Scott

This week, Scott works on ESP32-S2 Pin Alarm and more.

You can see the latest video and past videos on the Adafruit YouTube channel under the Deep Dive playlist – YouTube.

Adafruit Update

Adafruit

Adafruit is stocked and shipping orders!

Now is the best time to get orders in for your favorite products, including holiday projects and gifts – Adafruit.

Adafruit Holiday Shipping Deadlines

Adafruit 20% Off

Adafruit is again offering a one-time use discount code of 20% off after adding two factor authentication (2FA) to ones Adafruit account. One per account. See this guide for details.

Shop Adafruit now

PSF Seeks a new Director of Resource Development

PSF

Director of Resource Development – Python Software Foundation – Adafruit Jobs Board.

The PSF is seeking to hire a Director of Resource Development to spearhead fundraising and sponsorship efforts! They are accepting resumes through January 14th, 2021.

News from around the web!

Adding chiptune music

Designing a modern retro console: Adding chiptune music to an Adafruit MatrixPortal M4 with CircuitPython – retro.moe.

Edge-lit orb

An edge-lit NeoPixel Orb by Geek Mom Projects – Twitter.

Testing PWM on DC motors

Testing PWM on DC motors

Testing the effects of PWM frequency settings on small DC motor spin thresholds and low-speed torque. Early results favor PWM frequencies of <125Hz – Twitter.

NeoPixel Tree

CircuitPython powered Christmas lights using an Adafruit Circuit Playground Express and Crickit boardTwitter and code via GitHub.

MagTag and NeoPixels

As Seen on the Adafruit Show and Tell – an Adafruit MagTag connected to a NeoPixel strip to brighten up an office – Twitter.

Peanut's Christmas

A holiday diorama with CircuitPython and an Adafruit Circuit Playground ExpressTwitter.

Matrix Portal Number Display

This is probably the dumbest way to do this, but I got numbers to show on my Adafruit Matrix Portal RGB matrix by reading them from a string in CircuitPython and then turning the pixels on. Why? Mostly to learn, partly to change the color by just adjusting the palette – Twitter.

CircuitPython IoT Trivia

CircuitPython IoT Trivia, ESP32-S2 OLED Version – GitHub.

Adafruit Matrix Portal LED Display Diffused Acrylic Stand

Adafruit Matrix Portal LED Display Diffused Acrylic Stand – Nothans.

Solar powered internet connected sprinkler

Solar Powered Internet Connected Lawn Sprinkler with MicroPython – Moving Electrons and Twitter.

Live coding Frogger in Python

Watching this guy live code Frogger in Python is a great way to learn the language – Bong Boing

Hackable Hardware

What’s the Value of Hackable Hardware, Anyway? – Bunnie Studios.

Python Type Checking

Python Type Checking – testdriven.io.

Python behind the scenes: how the Python object system works – Ten thousand meters.

Python Modulo in Practice: How to Use the % Operator – Real Python and Twitter.

Rich

Rich – a Python library for rich text and beautiful formatting in the terminal – GitHub.

Stand Out in a Python Coding Interview

How to Stand Out in a Python Coding Interview – Real Python and Twitter.

Full color PCB art

How we made full colour PCB art (on PCB conference badges) – pixel.curious.supplies.

PyDev of the Week: Benoît Bovy on Mouse vs Python

CircuitPython Weekly Meeting for December 14th, 2020 notes and on YouTube

#ICYDNCI What was the most popular, most clicked link, in last week’s newsletter? DESK OF LADYADA – Sleepy Sunday – Deep Sleep testing for ESP32-S2 & a new ESP32-S2 chip.

Coming soon

MagTag based Weather Display

E-Ink Weather Forecast for MagTag – the Adafruit MagTag 2.9” display is perfect for displaying a daily/weekly weather forecast on your fridge. Carter at Adafruit is working on the code and guide, coming soon – Twitter.

Serpano rev 2

Work on rev 2 of Serpano by arturo – a CircuitPython dev board designed for breadboards, with adjustable voltage rail, multiple GPIOs, a new STEMMA QT / Qwiic connector and a 1.3” 240×240 LCD – Twitter Thread.

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.

Targett ESP32-S2 Module Clips

This week we had two new boards added!

Looking for adding a new board to CircuitPython? It’s highly encouraged! Adafruit has four guides to help you do so:

New Learn Guides!

New Learn Guides

What’s Fresh Today? In-Season Produce Reminder for Adafruit MagTag from Phil Burgess

MagTag Tides Viewer from Carter Nelson

MagTag Showerthoughts and Quotes from John Park

Cheerlights Holiday Wreath with Animations from Kattni

MagTag Daily Christmas Countdown from Noe and Pedro

CircuitPython Libraries!

CircuitPython Libraries

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 libraries, download the Adafruit CircuitPython Library Bundle. For the latest community contributed libraries, download the CircuitPython Community 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! 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 286!

New Libraries!

Here’s this week’s new CircuitPython libraries:

Updated Libraries!

Here’s this week’s updated CircuitPython libraries:

What’s the team up to this week?

What is the team up to this week? Let’s check in!

Bryan

This week, I’ve been working with the SCD30 NDIR eCO2 sensor from those fine sensing folks at Sensirion, who take their sensing very seriously. Looking at the SCD30, you can immediately tell that this is not like most other sensors, at least the ones we normally see. The NDIR I mentioned stands for “NonDispersive InfraRed”, which signifies that the SCD30 uses infrared spectroscopy to measure the CO2 in its environment.

Bryan

In essence, the SCD30 measures the amount of CO2 by shining IR light into the sample measurement area and measuring the amount of light within a narrow wavelength band corresponding to what is absorbed by CO2. You’ve basically got a little optics lab built into a breakout! In case you were on the fence, I’m pretty sure this is confirmation that we’re living in the future.

Bryan

In other news, the hot tip from sources on Varick street is that nearly every sensor manufacturer just released a revision of one of their sensors in the last month or so, which means… more sensor breakouts! Expect to see some more sensors headed your way over the next month or so, and if that doesn’t move you, perhaps some of the boards we’re eyeing for after the current batch of sensors will do that for you!

Dan

I am working on adding persistent memory to CircuitPython that is maintained even during deep sleep. This is not flash, which could wear out if you wrote it too often, but a special section of low-power RAM. Its contents go away if power is removed completely, but otherwise it survives through all kinds of sleep.

I am also writing an introductory guide to the new sleep and alarm capabilities.

We thought there might have been an issue with the ADC battery monitoring on the MagTag. I did several checks, including comparing with an external ADC, and instrumenting the ADC code to check the raw values, and all that appeared to be OK. A simple change to the MagTag library fixed the problem.

Jeff

I’ve been putting the finishing touches on a guide for creating your own pogo-pin jig.

Jeff

I’m also excited that the long awaited Feather M4 CAN is in the store; several months ago I wrote the code that allows this functionality to be used from CircuitPython.

Jeff

Kattni

This week I published the Cheerlights Holiday Wreath with Animations guide. Cheerlights is an IoT project that allows folks to sync up LED colors across the world by sending a message on Twitter. I took it one step further, and instead of simply lighting up the LEDs, it displays a different LED animation for each color. This project uses the Adafruit MagTag and a NeoPixel strip – no soldering required. Whether you’re familiar with Cheerlights, or new to it entirely, this project is a fun and festive way to display different LED animations.

Kattni

I updated the SGP30 guide to feature the new STEMMA QT version of the breakout, as well as starting the guide for the next generation, the SGP40.

I also started the guide for the new Feather M4 CAN Express board. If you’re looking to learn all the details about your new Feather CAN board, keep an eye out for this guide.

Lucian

This week I fixed a couple of bugs that popped up in the ESP32-S2 port, including a memory leak that was occurring in AnalogIO and some continuing effort towards fixing the reset system for individual pins. I also helped to investigate other issues with the ESP32-S2’s ADC, relating to calibration behavior when measuring near the min or max voltages, which were impacting battery readings on the MagTag.

I’ve also been working on completing PWMOut on the i.MX. As with most of the common-hal modules that use “sets” of peripherals, a lot of it is just creating a reservation system that prevents you from picking PWM drivers on the chip that are already in use, and then testing for bugs. It’s been a bit of a slog, since NXP’s examples and drivers are very tied to the idea that you’ve designed your whole system before compiling (ST’s HAL has similar limitations). But with CircuitPython, your whole program is always designed at runtime, so there’s a lot of wading through enums, macros and tables in order to get things working smoothly.

Melissa

This past week, I worked on a couple fairly major projects. First was creation of a Unified Portal library, which I called PortalBase. The intention of it is to hold the common functions for the Portal libraries such as MagTag, MatrixPortal, and both PyPortal libraries. That way if we find a bug in one of them, it doesn’t require 4 or more fixes. I ended up writing that and also porting the MagTag library over to use it. The port went well and any scripts that use the MagTag library require no changes in order to use it. I’d like to port over the other libraries in the next couple of weeks and will hopefully get similar results.

The other major project that I worked on was adding stub loading functionality to the Web Serial ESPTool. The way that stub loading works is it takes some binary data – called stub code – and writes it into the RAM of the ESP32-S2 and then sends a command to run that stub code. Once I was able to get a good “Hello” response from the stub that was running, it became much easier. The stub code basically listens for some extended commands that are not available by default on the ESP32-S2. This allowed some additional functions such as erasing the entire flash and programming files that are larger than 2MB.

Scott

This week I picked up deep sleep from Dan. We got my first pull request merged that reorganized sleep internally so that it would shut everything down gracefully before sleeping. It also changed the pretend deep sleep to behave more like real deep sleep. (We pretend to deep sleep when USB data is connected so it’s easy to iterate on code that deep sleeps.) Now, boards can be init and deinit to shut down board circuitry while asleep.

Once done with that, I jumped right into adding PinAlarm support. It allow you to sleep until the value on a pin is either high or low. This allows the code to wake on button press or interrupt from a sensor. It’s more dynamic sleep than what one can do with time based alarms. I’ve gotten it mostly working but need to fix a few bugs before making a PR.

Upcoming events!

linux.conf.au 2021

Australia’s grassroots Free and Open Source technologies conference linux.conf.au is scheduled for January 23-25 2021 online/worldwide. Limor “Ladyada” Fried, electrical engineer and founder of Adafruit, will be one of their keynote speakers. In her keynote, Limor will discuss how Python is snaking its way into hardware, Linux single board computers and more.

The schedule and tickets are available at lca2021.linux.org.auAnnouncement.

FOSDEM 2021 Python Developer Room

FOSDEM is a free and non-commercial event organised by the community for the community. Typically hosted in Brussels, Belgium, FOSDEM 2021 is taking place online February 6-7, 2021. This year, there will be a Python Developer Room. Details – Adafruit Blog.

PyCascades 2021

PyCascades is a regional PyCon in the Pacific Northwest, celebrating the west coast Python developer and user community. Held online February 19th – 21st, 2021 – PyCascades.

2021 Open Hardware Summit

The 2021 Open Hardware summit will be held online, Friday April 9, 2021. The summit will be livestreamed, but ticket holders will have access to additional interactive portions of the summit like meet-and-greets, workshops, and sponsor booths. Find details, including ticket and sponsorship information at 2021.oshwa.orgOSHWA.

PyCon US 2021

PyCon US, the annual official annual Python gathering, has been announced to be held online May 12-15, 2021. Sprints will be held May 16-18, 2021. More information and signups at https://us.pycon.org/2021/

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.

Latest releases

CircuitPython’s stable release is 6.0.0 and its unstable release is 6.1.0-beta.2. New to CircuitPython? Start with our Welcome to CircuitPython Guide.

20201212 is the latest CircuitPython library bundle.

v1.13 is the latest MicroPython release. Documentation for it is here.

3.9.1 is the latest Python release. The latest pre-release version is 3.10.0a3.

1,930 Stars Like CircuitPython? Star it on GitHub!

Call for help – Translating CircuitPython is now easier than ever!

CircuitPython translation statistics on weblate

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

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.

26,166 thanks!

26,166 THANKS

Adafruit Discord

The Adafruit Discord community, where we do all our CircuitPython development in the open, reached over 26,166 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

ICYMI

The wonderful world of Python on hardware! This is our Python video-newsletter-podcast! The news comes from the Python community, Discord, Adafruit communities and more and is reviewed on ASK an ENGINEER Wednesdays. 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

Contribute!

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. You may also tag your information on Twitter with #CircuitPython.

Join our Discord or post to the forum for any further questions.