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

View this email in your browser.

Happy Tuesday! 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. A great amount has happened this week:

CircuitPython Day is Tomorrow – Wednesday 9-9-2020!

CircuitPython Day: 9-9-2020

Tomorrow, September 9, 2020 (9/9/2020), is CircuitPython Day, the day in which Adafruit and the community worldwide celebrate CircuitPython. Happenings and events will occur throughout the day. See individual events worldwide below.

Adafruit Events

All times are in US Eastern (New York) time:

Times Event Link
10am – 11am Getting Started with CircuitPython – Hosted by Dan Adafruit Streams
11am – 12pm Central American / Spanish Show and Tell – Hosted by Álvaro Figueroa and Kattni
2pm – 3:30pm CircuitPython Weekly Discord Meeting – CircuitPython Day edition https://adafru.it/discord
4pm – 5pm Jeff and Kattni Project Livestream – Hosted by Jeff and Kattni Adafruit Streams
5pm – 7pm Deep Dive w/Scott Shawcroft Adafruit streams
7pm – 8pm Show & Tell Weekly Show – CircuitPython Theme https://learn.adafruit.com/show-and-tell
8pm – 9pm Ask an Engineer Weekly Show – The CircuitPython Team guest stars https://www.adafruit.com/ask

Dia CircuitPython Central America

More information at https://diacircuitpython.org/, all times local (US Mountain) on YouTube.

Times Event Host(s)
0900 ¡Show and Tell en Español! Álvaro Figueroa & Kattni Rembor
1000 Creando Faroles de Independencia con CircuitPython Álvaro Figueroa
1100 El Internet de las Cosas y Micro/CircuitPython Bentley Born
1300 Crea tu hardware con Circuitpython Andrés Sabas
1400 Introducción a CircuitPython Yeffri J. Salazar
1500 CircuitPython sobre Linux con RaspberryPi Gustavo Salvador Reynaga Aguilar
1600 Echando a andar UF2 y CircuitPython en un microcontrolador ARM Josue Isem
1700 Consumiendo APIs con MicroPython Jorge De Paz

Hackerlab Sacramento

Hackerlab in Sacramento, California has over 3 hours of virtual events planned for CircuitPython Day and everyone is invited.

Details can be found here, all times are US Pacific.

Times Event
4:30 PM CircuitPython FB/YouTube Live Stream Demo of Adafruit devices and CircuitPython programming
5:30 PM Free Zoom Circuit Playground Intro Class – Instruction and Discussion using a simple Thunder/Lightning prop
7:15 PM Open Discord Community Chat/Q&A of All Things Maker

Dedication

This year CircuitPython Day is being dedicated to Lamba Labs Makerspace, who are helping during the Beirut disaster.

Lamba Labs Makerspace

The 99th Newsletter and Python on Hardware Video

99th Newsletter and Python on Hardware Video

This issue, corresponding to CircuitPython Day, is the 99th issue of both this newsletter and the accompanying Python on Hardware Video produced from newsletter content. 99 is just the snakiest number to have things coincide with CircuitPython Day on 9-9!

A New Version of MicroPython Released

MicroPython

A new version of MicroPython has just been released: Version 1.13. It includes a new uasyncio module, code formatting, and BTstack bindings with Unix support. For the ESP8266, the default filesystem has changed from FAT to littlefs v2 – MicroPython Release Notes.

CircuitPython Deep Dive Stream with Scott Shawcroft

Deep Dive with Scott

This past week, Scott streams his work on a Requests recap and ESP32-S2 PR iteration.

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

Note: Scott’s Deep Dive this week will be on CircuitPython Day, Wednesday September 9th at 5pm to 7 pm (1700 to 1900) US Eastern Time.

Adafruit Update

Adafruit

Adafruit is shipping orders!

Adafruit is stocked and shipping orders!

Now is the best time to get orders in for your favorite products, including items for students.

Science is fun and educational when using Adafruit parts and free, easy to follow tutorials in the Adafruit Learning System.

Shop Adafruit now

News from around the web!

Fallout 4 Tank

Fallout 4 Tank

A tank tread vehicle programmed in CircuitPython. There’s a motor FeatherWing and a Seesaw in the body, and a Feather M4 express with an RFM95 in the turret. There are also a few mosfets for the lights and lasers. And a video transmitter is in the turret. All in Fallout 4 Vault-tec blue and yellow – Twitter.

Companion Bot

North Woods DevStudio writes:

I saw the TFT/Joystick FeatherWing and I just needed to make a virtual pet with it. After mixing together a Feather M4 Express, TFT/Joystick FeatherWing and some code, Companion Bot was born. He’s too cute and fun to keep him just to myself. In celebration of CircuitPython Day I made him public. Enjoy Companion Bot as he chats, dances, shop, fights and plays cards.

More – GitHub.

Readerboard

readerboard – an information display using a RGB LED matrix and the Adafruit RGB Matrix Bonnet for Raspberry PiHackaday, GitHub and YouTube.

Harry Potter IR Remote

A simple Python script that is controlled by the Harry Potter universal remote control wand made by The Noble Collection. It requires a Raspberry Pi as the controller and a Flirc USB IR receiver in combination with the universal remote wand to control functions in the script – Instructables and GitHub.

Homeschool Foot Switches

A child needed USB input foot pedals for computer keyboard shortcuts, working from home/online school. This simple contact switch implementation uses an Adafruit Gemma M0 board, programmed in CircuitPython, to read the switch presses and output defined values as USB HID keyboard text – Twitter.

Encoder Inputs with CircuitPython & Arduino

Encoder Inputs with CircuitPython and Arduino – YouTube.

Writing Pythonic Loops

How to Write Pythonic Loops – Video – Real Python.

handcalcs

handcalcs is a library to render Python calculation code automatically in Latex, but in a manner that mimics how one might format their calculation if it were written with a pencil: write the symbolic formula, followed by numeric substitutions, and then the result. Because handcalcs shows the numeric substitution, the calculations become significantly easier to check and verify by hand – GitHub.

tesserocr: a simple, Pillow-friendly, wrapper around the tesseract-ocr API for Optical Character Recognition (OCR) – GitHub.

Python Tools for Managing Virtual Environments

Python Tools for Managing Virtual Environments – dev.to

Cool New Features in Python 3.8

Cool New Features Added in Python 3.8 – Real Python.

Pytest Plugins to Love

Pytest Plugins to Love – a top 5 and honorable 50 out of 700+ plugins to get nicer output and faster execution – toward data science.

fastcore Library

fastcore: an underrated Python Library – it that extends the Python programming language and provides utilities that enhance productivity – fastpages.

Spatial thinking with Python

Spatial thinking with Python by Sangarshanan. This talk covers the importance of spatial data & how to store, manipulate & visualize it. It also covers QGIS & building geospatial dashboards – PyVideo.

Garbage Collection in MicroPython

The Melbourne MicroPython Meetup had a deep dive earlier this year on the MicroPython Garbage Collector – GitHub.

Common Python Data Structures

Common Python Data Structures Guide – Real Python.

Scraping YouTube Videos Data in Python

Scraping YouTube Videos Data in Python – YouTube.

For hackers: pyc anti decompiler techniques (3 videos) – YouTube.

The Mouse vs Python PyDev of the Week: Nathan Epstein

#ICYDNCI What was the most popular, most clicked link, in last week’s newsletter? Getting Started With CircuitPython On Compatible Microcontroller Boards.

Coming Soon

Adafruit QT Py

QT Py! A new board from Adafruit! QT Py is a SAMD21 board featuring a USB C connection and it is plug n play with any STEMMA QT board. CircuitPythonista Jepler requested that the QT Py have a spot for external flash chip on the bottom for expansion and voila rev B, with a SOIC 8 on the bottom connected to a hardware SPI port – Twitter and Adafruit.

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 there are 149 CircuitPython compatible boards! The 150th is set and will be announced very soon in a celebration of 150 CircuitPython boards!

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

New Learn Guides!

Adafruit Learning System New Guides

Busy Box Interruption Sign from Noe and Pedro

CLUE Rock, Paper, Scissors Game using Bluetooth from Kevin Walters

Updated Learn Guides!

Adafruit DRV8833 DC/Stepper Motor Driver Breakout Board from Kattni

Adafruit TB6612 1.2A DC/Stepper Motor Driver Breakout Board 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 267!

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

Bryan

The past week has been pretty productive! I’ve added a few more report types to the BNO080 library as well as the regular refactoring. Things are coming along well and it won’t be too long until I can start thinking about putting a bow on it. This is pretty exciting because I think it’s going to be a very popular sensor because it does a good job at making it easier for the user to get useful information from it, thanks to its built-in fusion sensor algorithms.

The most notable part of working on the BNO080 library this week is discovering that when you have multiple sensor or motion classifier reports enabled, by default all of the available reports will be batched together into one packet and sent back together. This escaped my notice until now because the reports are simply concatenated without any additional “packaging”, so I was always able to parse the first report which gave me just enough data to make it seem like everything was working fine.

Bryan

The big news in CAN bus land (or at least my corner of it) is that I’m now successfully sending CAN frames using the MCP2515 in CircuitPython, and they can be read and unpacked by the other devices on the bus! This is just the very first steps to getting something usable, however. There is still plenty of work to be done to bring this library up to the standard set by the existing Arduino libraries, in addition to whatever Pythonification (it’s a word, look it up) is needed to make it fit within the CircuitPython ecosystem.

Later this week, I’ll be working with Jeff/Jepler on sketching out the API that CAN devices of all sorts will use within CircuitPython. While I’m working with the MCP2515, he’s hard at work adding support for the CAN peripheral within the SAM-E51. Once we both get the basics of bytes flowing back and forth working, we’ll start planning a “minimum viable product” which is project manager speak for “an initial working example with no bells and a single whistle” with an implied “bell expansion pack coming soon!”

Dan

Dan

My initial _bleio HCI pull request has now been revised, approved, and is merged. I’ve touched up the adafruit_ble library to add the ability to specify an HCI adapter. After discussion with Scott, I created a separate adafruit_airlift library to handle HCI-adapter-specific initialization, instead of embedding it in the standard adafruit_ble library.

I released CircuitPython 6.0.0-alpha.3 late last week. I reviewed Scott’s pull request to add native ESP32 support for WiFi; it should be merged soon. So we’ll have another release with two big new pieces of functionality shortly. The new release will probably be beta.0, since we’ve finished up the API changes and additions we had in mind for CircuitPython 6.0.0.

Jeff

Jeff

What sounds like it should be simple, but turned out to take about a half week to resolve? A couple of bugs that were reported with RGB matrices. Once this Pull Request is merged, it will fix some bugs that community members and Adafruit folks reported. Before the fixes, these bugs would lead to Safe Mode or crashes requiring use of the reset button.

  • When RGBMatrix needs more RAM than was available, CircuitPython will now raise a MemoryError
  • A display small enough that it can’t even show a 1×1 terminal will work properly
  • RGBMatrix Displays can now be rotated, in case you want an extra tall display, like this 64×32 matrix in portrait orientation

Kattni

This week I’ve been working with stepper motors. We have had Arduino examples for using the DRV8833 and TB6621 stepper motor driver breakouts, but no CircuitPython. Now we have both! I added a new page to both guides with wiring diagrams, library install instructions, and a full code example. If you’ve looking to use these drivers with CircuitPython, check out the guides to get stepping!

I also created and worked on the FeatherWing 128×64 OLED guide. It’s a new Wing we released recently with double the display of the previous OLED FeatherWing. There’s no CircuitPython support currently, but it is in the works. For information on pinouts, assembly, and resource downloads, check out the guide once it’s published.

Lucian

This week I worked on debugging a display related crash for the ESP32, along with some other buried issues related to the ESP32 stack. It was a good opportunity to get GDB up and running with Espressif’s software packages, which is a somewhat non-trivial process – debuggers like the Jlink aren’t natively supported, and it takes some fiddling around with FreeRTOS settings to get the debugger to connect. Now that it’s fully enabled, it’ll be easier to visualize tough bugs, and track down stack corruption more systematically.

I also worked on adding STM32 F103 family support this week. It’s not fully complete yet, but I’ve added flash and filesystem support, which was a tricky hurdle for newer developers to the port, and solved some of the issues holding up USB.

Melissa

This past week was quite productive. I started out by writing the Adafruit_Python_Shell library to make converting shell scripts over to Python easier to do and maintain. I updated a couple of scripts that I had convert to use the library and they shrank to nearly 50% or their previous size.

After that, I updated the MatrixPortal library and made some improvements such as adding a Middle Graphics layer so setting the background was much easier. I also exposed the network and graphics objects so I didn’t need to keep adding functions in 2 places every time I added something new. I added some Adafruit IO functions to the library and updated the Adafruit IO library for CircuitPython so that all the data can be grabbed instead of just the first and last values.The reason I was adding that functionality is because I was working on a demo for John Park’s workshop so we can use Adafruit IO to grab data and display it on the Matrix.

While I was working on that functionality, I decided to add a requested feature so that the ESP32SPI Wifi can now use multiple access points which can be handy if you’re moving between locations. It will cycle between the different sets and is backwards compatible.

Melissa

The other project I worked on was the STM32MP1 so that we can get Blinka running on it. I had put in some time a few weeks ago, but ended up putting it on hold when I couldn’t get Pip running on it. After that, I was just working on it a little at time as I had some free time. I found there was a newer image than the one that came with it and so after some experimentation, I figured out how to update it using the STM32MP1 to flash the SD card. The method I found to work was not such a straightforward method, especially since the software STM32CubeProgrammer would crash on MacOS.

It turns out that there’s a Command line interface core hidden inside that can be run from the terminal to write the new image. With the new image, I tried once again to get pip installed and this time I was successful. Once I knew I had a good image, I used ApplePiBaker to backup a copy and verified the image could be written just using BalenaEtcher, so we now have a much easier way to update on all systems.

Scott

This week I’ve been focused on the Requests library. I made a lot of changes to add support for HTTP 1.1, lower memory when loading JSON, and the newer wifi API introduced with the ESP32S2’s native wifi. Unfortunately, I wasn’t very confident that I wouldn’t break existing uses.

So, I decided to write a few unit tests that verify that the requests logic works both with the new features and the old legacy API. Testing is a great way to build confidence in functionality. By running the tests every code change you also ensure that the functionality continues to work.

I’ve created the PR for review and will be testing it with existing projects. If (who am I kidding), when, I find bugs then I’ll add additional tests to detect the bug and then fix it.

On my stream today I plan on going over my requests changes and then doing a round of iteration on my native_wifi PR based on Dan’s feedback.

Upcoming events!

PyGotham TV

PyGotham is a New York City based, eclectic, Py-centric conference covering many topics. PyGotham TV taking place October 2-3, 2020 with a single track of talks presented online – Event Website.

PyCon India 2020

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

Hackaday Remoticon 2020

The Hackaday Remoticon will take place everywhere November 6th – 8th, 2020. It’s a weekend packed with workshops about hardware creation, held virtually for all to enjoy – Hackaday.

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 5.3.1 and its unstable release is 6.0.0 Alpha 3. New to CircuitPython? Start with our Welcome to CircuitPython Guide.

20200906 is the latest CircuitPython library bundle.

1.13 is the latest MicroPython release. Documentation for it is here.

3.8.5 is the latest Python release. The latest pre-release version is 3.9.0rc1.

1,818 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.

24,806 thanks!

24806 THANKS

Adafruit Discord

The Adafruit Discord community, where we do all our CircuitPython development in the open, reached over 22,806 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 first video-newsletter-podcast that we’ve started! The news comes from the Python community, Discord, Adafruit communities and more. Kattni turns the weekly news into video form for ASK an ENGINEER and Adafruit social media. 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 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.

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.