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

View this email in your browser.

Welcome to this week’s Python on Microcontrollers newsletter, brought you by the community! Featured in this issue: two focus sections – one for USB HID (keyboard/mouse) projects and one for MIDI music projects. Python on Microcontrollers, with prebuilt libraries, makes creating projects with these capabilities so much easier and shorter than in the past with Arduino.

Network with your fellow Pythonistas! 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 get started!

CircuitPython 6.2.0 Beta 2 Released!

CircuitPython 6.2.0 Beta 2 Released!

CircuitPython 6.2.0 Beta 2 was recently released. This is the third beta release of CircuitPython 6.2.0. This release contains fixes and improvements, most notably for RP2040 and ESP32-S2 based boards – Adafruit Blog.

Visual Studio Code comes to Raspberry Pi

Visual Studio Code comes to Raspberry Pi

Visual Studio Code officially comes to Raspberry Pi. As well as supporting Debian Linux on x64, there are now builds for ARM and ARM64 – both of which can run on Raspberry Pi OS (the ARM build on Raspberry Pi OS, the ARM64 on the beta of the 64-bit Raspberry Pi OS) – Raspberry Pi Blog.

Focus: MIDI – Digital Music

With MIDI baked into CircuitPython, getting new boards like the Raspberry Pi Pico using this music standard is straightforward. Below are some projects using MIDI posted on the internet this week.

A Drum Machine with a Raspberry Pi Pico

Drum machine

A USB Midi 16 channel step sequencer for Raspberry Pi Pico, written in CircuitPython v6.2.0 – Twitter and code on GitHub.

More MIDI Projects

RGB MIDI Controller

Andy made a MIDI controller using a Raspberry Pi Pico with a Pimoroni RGB Keypad and Adafruit CircuitPython. Thanks to Sandy MacDonald for the code and iPad Pro – Twitter and GitHub.

Tiny2040 MIDI

Receiving MIDI on the forthcoming RP2040-powered Tiny2040 from Pimoroni. MIDI notes over USB make the LED light red, but you could hook up a whole chain of NeoPixels and have them blink in time to your music, or have solenoids hit a real drum, you name it! Programmed in CircuitPython – Twitter.

MIDI In

MIDI In for 3.3V Microcontrollers – using a Raspberry Pi Pico or Circuit Playground Express and CircuitPython/MicroPython – DIYelectromusic via Twitter.

Focus: HID Keyboards

Using CircuitPython boards for USB HID (Human Interface Device, re. keyboards and mice) has been appealing to new Raspberry Pi Pico project builders. Keyboards, software control, and mouse control are all possible with USB HID. Relevant Adafruit Learning System guides:

Here are some of the projects using HID this past week.

The Pico Producer – a Raspberry Pi Pico-based 12 Key HID Keyboard

Pico Producer

Pico Producer

 

Fritzing

Pico Producer is an OBS Controller using a Raspberry Pi Pico, a 3D printed case and CircuitPython – GitHub and Twitter.

More Keyboard/HID Projects

Raspberry Pi Pico - USB HID Auto Clicker with CircuitPython

Making a USB HID Auto Clicker with Raspberry Pi Pico and CircuitPython – YouTube.

Tweeting from a Pico

Tweeting from a Raspberry Pi Pico (using HID keyboard and CircuitPython) – Twitter.

Macro keyboard

A wireless, bluetooth macro keyboard, powered by an Adafruit ItsyBitsy nRF52840 and CircuitPython – Twitter.

News from around the web!

Valentine's Day Pico

A Valentine’s heart display using a Raspberry Pi Pico, a Pimoroni pico display and MicroPython – Twitter.

RGBW Ring Light Hack

Hacking a RGBW photo ring light with a Raspberry Pi Pico running CircuitPython – Twitter.

LED strips embedded in acrylic

Playing around with LED strips embedded in acrylic (both clear and translucent) – Twitter.

Keeping secrets and writing about Raspberry silicon

Keeping secrets and writing about Raspberry silicon by Alasdair Allan – Raspberry Pi Blog.

Raspberry Pi Pico-Based 2FA

Picoth Is a Raspberry Pi Pico-Based 2FA Gadget – hackster.io.

3D-printed Ring Light

Build Your Own 3D-printed Ring Light to Upgrade Your Remote Meetings, uses a Circuit Playground Bluefruit, NeoPixels, and CircuitPython – Southern Fried Science.

Dreamcast Logo Animation

Adding an animated Sega Dreamcast badge using an Adafruit Clue and CircuitPython – Cosmic Bren and Hackaday.

Hands-On: RISC-V ESP32-C3

Hands-on: The RISC-V ESP32-C3 might be your new ESP8266 – Hackaday via Twitter.

Pico with a 7 segment display

A Raspberry Pi Pico connected to an HT16K33 Display with CircuitPython – Twitter.

Temperature and Humidity

A temperature and humidity display with Raspberry Pi Pico, Adafruit sensor and CircuitPython – Twitter.

PyPortal NPR Station

Making a PyPortal NPR Station with CircuitPython – GitHub via Twitter.

Pico/CircuitPython/Windows

Building an environment for Raspberry Pi Pico development with CircuitPython in Windows (Japanese) – Twitter and Blog.

CircuitPython and GD3X progress

CircuitPython and GD3X progress: GD3X graphics boards interfaced to an Adafruit Feather M4 Express, Raspberry Pi Pico and Teensy 4.0 – tinyletter.

DynaLoRa-USB

BH Dynamics’ DynaLoRa-USB Offers an Arduino, CircuitPython Entry Point for LoRa Experimentation – hackster.io via Twitter.

Motor Control

A Python Library to enable a Raspberry Pi to control many different Electrical Motors, like BLDC, PMSM, DC, and ACIM, in a single platform – SOLO via Twitter.

Memory Game

A colorful memory game with Raspberry Pi Pico and MicroPython – Twitter.

Micro Web Server

MicroWebSrv2 is the new powerful embedded Web Server for MicroPython and CPython supporting route handlers, modules like WebSockets or PyhtmlTemplate and simultaneous requests in the thousands – GitHub.

Raspberry Pi Pico wired to an MCP3008

Raspberry Pi Pico wired to an MCP3008 programmed in MicroPython – RAREblog.

100 Page Python Intro

100 Page Python online guide – GitHub.

Blazing fast Python

Blazing fast Python: Profiling Python applications using py-spy – Medium.

Web Scraping 101 with Python

Web Scraping 101 with Python – ScrapingBee.

Use Poetry to Manage Python Dependencies

A Poetic Apology, or Why Should You Use Poetry to Manage Python Dependencies – Mutt Data Blog.

WTF Python

WTF Python – exploring and understanding Python through surprising snippets – GitHub.

Python “tricks” I can not live without – gitconnected.

Python behind the scenes: how Python integers work – TenThousandMeters.

flynt – a tool to automatically convert old string literal formatting to f-strings – GitHub.

finicky – easy data validation in Python – GitHub.

Pattern matching accepted for Python

Controversially, pattern matching accepted for Python 3.10 – lwn.net.

Welcoming Google as a Visionary Sponsor of the PSF – PSF Blog.

Learn Python with the Women in Tech Personality Quiz

Learn Python with the Women in Tech Personality Quiz – locksleylk.com.

PyDev of the Week: Aly Sivji on Mouse vs Python

In honor of Presidents’ Day, the CircuitPython Weekly Meeting was moved to Tuesday February 16, 2021 and the video URL was not available at press time. It will be added to the CircuitPython Weekly Meeting playlist on YouTube soon.

#ICYDNCI What was the most popular, most clicked link, in last week’s newsletter? Display Raspberry Pi Pico overlay in Adafruit AR Update.

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 two new boards added!

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

New Learn Guides!

New Learn Guides

QT Py Heart Shaped NeoPixel PCB from Noe and Pedro

Adafruit Sensirion SHT40 Temperature & Humidity Sensor from Kattni

Updated Learn Guides!

CircuitPython Essentials: CircuitPython Pins and Modules from Kattni

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 298!

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!

Dan

I released CircuitPython 6.2.0-beta.2, which has dozens of fixes and improvements, including fixes for some serious issues.

I fixed the adafruit_sdcard library to work properly with the new native adafruit_bus_device module. I’ve also been investigating I2C problems on the RP2040. One was a red herring, and the other seems peculiar to a particular sensor.

I’m continuing to work on the second USB serial channel for CircuitPython. Scott and I discussed and settled on the outlines of the Python API. There will probably be a usb_cdc module, with a fixed instance of the serial object, but with the flexibility to add more later.

Jeff

After taking a week off to read a book & work on my own projects, I’m back! I’m learning about the RP2040’s “PIO” peripheral and with the help of community members I resolved a problem affecting NeoPixels on the Raspberry Pi Pico and other RP2040 boards. I also made a change to the tools that build the various “bundles”, which should help circup by providing the “requirements.txt” files directly within the bundle; circup uses “requirements.txt” to decide what other libraries are needed to go with the requested library.

Kattni

This week I finalised the new page in the CircuitPython Essentials guide, and got it mirrored into every CircuitPython-compatible microcontroller guide. It covers using import board and dir(board) to tell CircuitPython where to look for the hardware you connected to your project, and how to learn about what pins and board objects are available for your microcontroller. It also explains how to find the built-in modules available for your board.

I published the SHT40 guide as well, which has everything you need to get started sensing temperature and humidity with this excellent sensor. I published the ISO1540 guide as well. I completed quite a bit of miscellaneous from my long to-do list.

I’m currently working on the guide for the AW9523. It’s nearly done, but needs some final touches. It should be live quite soon. I’m also adding at least one more example to the Getting Started with Raspberry Pi Pico and CircuitPython guide, which should also be available soon.

Lucian

This past week I fixed a number of internal errors in the Socket module, such as inconsistencies in internal types, connection failures for accepted sockets, and a multi-layered disconnection problem in the Requests library. I also resolved an issue with I2C not correctly sending a Repeated Start condition when requested.

These issues required updates to my manual testing scripts, which have gradually accumulated over my time working on CircuitPython. Since many of these tests might be helpful to others doing reviews or trying to resolve their own issues, I’m working on a new manual tests directory to store and share them, along with associated documentation.

Melissa

This past week I worked on adding ESP32-S2 support to ESPHome. I had to get past a number of bugs. Unfortunately as I got closer to the end, I came to one that stopped me from progressing any further for the moment and that is WiFi refused to connect when I had I2C enabled. Even if I wasn’t doing anything with it. I submitted a bug report to the package which I think is the culprit and I will be moving on to some other projects in the meantime.

Scott

This week I’m on the home stretch for audio playback with the RP2040. I got both single sample buffer and WaveFile playback with PWM audio, see the pull request.

I’ve begun work hooking up I2S which should be straightforward (fingers crossed.) Since we’ll use the PIO for I2S, I’m also adding a few more APIs to the StateMachine class.

Once I’m out the audio weeds, I’ll be circling back to internal flash config with a possible detour to implement UART if no one has beat me to it.

Last night I also hacked a system to allow me to use my right hand on my keyboard for mouse clicks. I’m very happy with it so far.

Upcoming events!

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.

GeoPython 2021

The online GeoPython conference is focused on Python and Geo, its toolkits and applications. April 22-23, 2021 – https://2021.geopython.net/.

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.1.0 and its unstable release is 6.2.0 beta 2. New to CircuitPython? Start with our Welcome to CircuitPython Guide.

20210214 is the latest CircuitPython library bundle.

v1.14 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.0a5.

2,298 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.

Job of the Week

Enrollment Director – Bluestamp Engineering – Adafruit Jobs Board.

27,469 thanks!

27,469 THANKS

Adafruit Discord

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