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

View this email in your browser.

Happy July! 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 get started!

CircuitPython on the Seeed Studio Wio Terminal

Seeed Studio's Wio Terminal Gets CircuitPython Support

Seeed Studio's Wio Terminal Gets CircuitPython Support

The Wio Terminal, an all-in-one microcontroller development kit which includes sensors, buttons, Grove connectors, and a screen, is now officially-supported in CircuitPython.

The Seeed ‘s Wio Terminal is an ATSAMD51-based microcontroller with wireless connectivity supported by a Realtek RTL8720DN. Its CPU speed runs at 120MHz (Boost up to 200MHz). Realtek RTL8720DN chip supports both Bluetooth and WiFi providing the backbone for IoT projects. The Wio Terminal itself is equipped with a 2.4” LCD Screen, onboard IMU(LIS3DHTR), microphone, buzzer, microSD card slot, light sensor, and infrared emitter(IR 940nm). Note: The RTL8720DN isn’t currently supported from CircuitPython. Therefore, WiFi and Bluetooth will not currently work.

More – hackster.io and CircuitPython.org.

CircuitPython 6.0.0 Alpha 1 released!

CircuitPython 6.0.0 Alpha 1 released

The first alpha release of CircuitPython 6.0.0 is out now. It is a renumbered version of 5.4.0 because i2cslave module and class have been renamed to i2cperipheral. It is alpha because the developers may remove or rename additional APIs. It is relatively stable.

Feature-wise, this stable release adds basic lower power support when in time.sleep() and initial ESP32-S2 support. The lower power work changed time keeping and may have introduced bugs. Please use 5.3.0 if you need a stable version of CircuitPython.

New features and improvements since 5.4.0 Beta 1

  • Added sdioio and sdcardio for native SDCard support. Available on SAMD51 and spresense. Thanks to @jepler and @kamtom480.
  • Added busio support to ESP32-S2. Thanks to @tannewt
  • Add support for SAME54. Thanks to @jepler
  • Add global navigation satellite system (gnss) support for Spresense. Thanks to @kamtom480
  • Improved ESP32-S2 performance. Thanks to @tannewt and @DavePutz
  • Updated ulab thanks to @jepler and @v923z
  • Fix time.sleep() after it has been ctrl-c’d. Thanks to @DavePutz
  • Fix microcontroller.cpu.temperature read hang. Thanks to @dhalbert
  • Fix ScanEntry prefix matching when any=False. Thanks to @dhalbert
  • Fixed port D pins on STM32 LQFP64 boards. Thanks to @hierophect
  • Fixed I2C timing on STM32 F7 and H7. Thanks to @hierophect
  • Fixed display refresh when changing palette transparency. Thanks to @DavePutz
  • Meowbit build is now UF2 rather than a bin. Thanks to @hierophect
  • Documentation improvements thanks to @AndrewR-L
  • Improved Dutch, German, Brazilian Portuguese and Spanish translations. Thanks to @buchen, @fede2cr, @ryevertigo, and @wtuemura.

A full commit log is here.

Breaking changes since 5.x

  • i2cslave is now i2cperipheral and the class in it is changed as well.
  • New boards since 5.4.0 Beta 1
  • Seeeduino Wio Terminal Thanks to @ansonhe97
  • Atmel SAME54 Xplained Thanks to @jepler
  • Loc Ber M4 Thanks for @florin-trutiu
  • UnexpectedMaker FeatherS2 Thanks to @tannewt and @unexpectedmaker

Read more – Blog Post, GitHub Release Page and hackster.io.

CircuitPython on a Watch

CircuitPython Watch

A watch running CircuitPython, based on the Open Hardware Summit 2020 badge – Adafruit Blog and Twitter.

SciPy 2020

SciPy 2020

SciPy 2020, the 19th annual Scientific Computing with Python conference, is a virtual conference being held July 6-12, 2020. The annual SciPy Conference brings together over 900 participants from industry, academia, and government to showcase their latest projects, learn from skilled users and developers, and collaborate on code development. The full program consists of 5 days tutorials and talks (July 6-10) and 2 days of developer sprints (July 11-12) – Event.

Python Resource Humble Bundle

Python Book Humble Bundle

Humble Bundle is offering a “Pay what you want” offer for Python learning texts. $1,400 worth of materials. And portion of each sale goes to the Python Software Foundation. – Humble Bundle.

CircuitPython Deep Dive Stream with Scott Shawcroft

Deep Dive with Scott

This week, Scott streams his ESP32-S2 SPI bug recap discusses networking.

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

Please Shop Adafruit to support open source hardware, software, and publications like this newsletter.

News from around the web!

Game on LED Matrix

Liz ported the Blinka Jump Game from using an Adafruit PyBadge to using an LED matrix display – Twitter.

Open Book Rev 5

Development on the Open Book eInk reader continues with a new revision out in the last week:

I’ve assembled and tested one; written a system test script and a sketch to burn the bootloader using a Feather M0; completed a first draft of the documentation, and I’m almost done with the Kitspace BOM. The goal for these is to sell the bare PCBs on Tindie, for folks who want to build at home. I had hoped to have that done by the end of June, but pandemic drama has slowed me down; still, they should be available by next week. Watch the Tindie store for updates.

More – Hackaday.io.

Big Honking Button

Designing Winterbloom’s Big Honking Button – a Eurorack module running CircuitPython – Thea Codes.

Aquarium Automation

The AquariumAutomation consists of an Adafruit Feather nRF52840 Express dev board plus 4 FeatherWings, running CircuitPython code – Twitter and GitHub.

ESP32-S2 WiFi

An Espressif Systems ESP32-S2 Saola running CircuitPython 6.0.0-alpha with the ESP32SPI library to also use an Adafruit AirLift FeatherWing for Wi-Fi.

Autoimports

With the new Pylance language server in the Visual Studio Code editor, you can now get auto-imports! – Twitter.

Pew Pew M4

A review of the Pew Pew M4 gaming and development platform – YouTube and Twitter.

Using Ultrasonic Sensors

Using Ultrasonic Sensors with CircuitPython and Arduino – YouTube

freeCodeCamp has Python Certifications

freeCodeCamp has added 4 new Python Certifications – freeCodeCamp.

requests + JSON in edublocks

After Les Pounder’s post about using requests + JSON in Python, All About Code tested out a new requests blocks in edublocks to create a simple COVID-19 tracker – Twitter.

Linux Marketshare

Linux Marketshare Climbed to All-Time High in June – OMG Ubuntu and Twitter.

PowerStamp Board

PowerStamp is a USB-C power management module that provides power source management and charge control for IoT devices, programmable in MicroPython – Kickstarter and Twitter.

MicroPython TTS Weather broadcast

A MicroPython TTS Weather Broadcast based on ESP32 and Audio – Guide and Twitter.

MicroPython Altair Simulator

Porting an Altair simulator to an ESP2866. 1+2=3. It uses MicroPython, an OLED display and IR for minimal (3 pin) GPIO. Octal data entry – Twitter.

Web Scraping Crypto Prices With Python

Web Scraping Crypto Prices With Python using BeautifulSoup – Towards Data Science.

KoNLPy: Korean NLP in Python

KoNLPy (pronounced “ko en el PIE”) is a Python package for natural language processing (NLP) of the Korean language – KoNLPy.

Create and Modify PDF Files in Python

Create and Modify PDF Files in Python – Real Python.

Free historical and live stock prices and FX rates using Python

Get free historical and live stock prices and FX rates using Python – Medium.

Learning Python 10 minutes a day

The Learning Python 10 minutes a day series – Towards Data Science.

Make Your Code Great, Python Style

Make Your Code Great, Python Style – Live Code Stream.

8 Advanced Tips to Master Python Strings – Towards Data Science.

7 cursos para aprender a programar con Python online gratis – TICbeat.

Python training for business analysts and traders by J.P. Morgan – GitHub.

JSON explained for Python users: Data Science Edition – Towards Data Science.

Guess this song

Guess the song that the “program” above refers to.

PyDev of the Week: Philip James on Mouse vs Python

CircuitPython Weekly Meeting for July 6th, 2020 (notes) on YouTube and on diode.zone.

#ICYDNCI What was the most popular, most clicked link, in last week’s newsletter? Adafruit CLUE Board.

Made with Mu

The Mu Python Code Editor

Why code your Python programs in 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 one new board 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!

title

Circuit Playground Express: Piano de Limones from Àlvaro Figueroa

74HC595 Shift Register from Kattni

Blinka Jump PyBadge Game from Liz Clark

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

New Libraries!

Here’s this week’s new CircuitPython libraries:

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

Another week, more libraries, and a new revision of the CAN FeatherWing. We decided to switch to using an older CAN controller at least for early iterations because the available libraries for it are more mature. Once we get a handle on things, we will consider moving to a newer and likely faster chip. I also worked on a quick and relatively simple CircuitPython library for the BH1750 ambient light sensor from Rohm.

Earlier in the week, I worked on wrapping up the CircuitPython library for the PCF8591 ADC+DAC combo chip but ran into some strange behavior while testing before release. When I was reading the ADC for more than one channel, the results for the channel were getting switched around! To cut a long story slightly shorter, after verifying that my wiring was correct I dug into the datasheet to read about the timing of how the ADC reads are trigger and returned. As it turns out, an ADC reading is triggered on the rising/trailing edge of the ACK/NACK clock pulse. The result for that measurement is returned in response to the second read after the measurement is triggered.

To understand why this caused me a headache, I’ll briefly explain how reading from a sensor on an I2C bus generally works. This is a very simplified diagram and not to scale, so bear with me:

Generally but not always, every I2C transaction between a microcontroller and a sensor on the bus starts with the address of the intended recipient

With that implied, to read a register, the normal pattern from the perspective of the micro:

Bryan

In these cases, you’re generally reading a register that already has the data available to send back, so after the microcontroller sends the address of the register it wants to read, it can immediately read the response back, even without giving up control of the bus.

Since in this case we’re talking to an ADC that starts taking a new measurement as soon as it’s requested, this won’t work because the data hasn’t been generated and it takes a bit of time to do so. Rather than sitting around waiting for the measurement to finish, the ADC kindly does two things at once: it starts measuring the requested channel, and while it’s doing that, it returns the result for the previous request. That ends up looking approximately like:

Bryan

This is explained in the datasheet, of course, and it even includes this handy diagram:

Bryan

So, you can see why our reads were delayed. It was by design! Once we accounted for this in the libraries, all was well, but it took some head scratching to figure out. Let this serve as a reminder: The Datasheet Has All The Answers (except for when it doesn’t and it’s in the errata that you neglected to read).

Dan

I’m continuing to work on an implementation of _bleio that supports the HCI Bluetooth protocol available on ESP32, used on our AirLift boards. I have “first light”: I can talk to the ESP32 and ask it simple commands.

I’ve also fixed a number of small bugs in various BLE libraries, and there are more still to fix.

We have decided to move our next CircuitPython alpha or beta release from 5.4.0 to 6.0.0, so that we can make some incompatible changes, which are allowed when we do a major version change.

Kattni

I’ve been working on various guides this week. I updated the BNO055 guide to include the STEMMA QT version of the board. As this board is so popular, we will continue carrying the previous header-only version as well, so the guide update was simply integrating the STEMMA QT version. I finished updating the ST 9-DoF Combo Boards guide with the final FeatherWing. I started work on a guide to using the 74HC595 shift register. The guide will provide basic info about the chip including pinouts. It will also include an example of using it to control 8 LEDs using CircuitPython, with a detailed wiring diagram to help you get it going.

We haven’t had PyPI download stats available for some time as the site we were getting them from instituted rate limiting and we were well over the limit with the number of libraries we were querying. Thanks to sommersoft’s research, we now have a way to roll our own query, though it has a few necessary prerequisites before we can get that going. We should have it up and have download stats available again soon.

As well, thanks to sommersoft, I have the tools necessary to shift the CircuitPython libraries from using the default branch master on GitHub to using the default branch main. I am looking forward to updating all of the CircuitPython libraries to this change to welcoming and inclusive language. We have already shifted the CircuitPython core to main, and will be making the move across the rest of the project soon.

Lucian

This past week I worked on creating a timer management system for STM32, which allows various different modules in the port to share a pool of timer peripherals. The system allows modules to prioritize certain kinds of timers based on whether they have pins exposed, aiming for the minimum number of conflicts possible between internal timer use (such as in modules like PulseOut or RGBMatrix) and external use (PWMOut). I also worked on some miscellaneous bug fixes to modules and peripherals affected by this new timer mediator, and fixed a crash related to simplex SPI on the STM32.

Melissa

Melissa

This past week I ported the PyPortal library over to Blinka so that many of the PyPortal examples work with little modification. As I’ve ported over examples, I’ve found small bugs both in the PyPortal library and displayio for Blinka that I have been slowly fixing, which is leading to a more stable displayio for Raspberry Pi and other Single Board Computers.

Scott

This last week I’ve tested and debugged the busio implementation on ESP32-S2. My stream last week was me stumped by internal seemingly being crossed when doing SPI. Only after the stream did I realize there was another setting that was messing me up. Luckily, I sorted it out and got the PR. It’s been reviewed and will be checked in shortly.

This week, I’m starting to work on our network related libraries and brainstorming what the API should be from CircuitPython on the ESP32-S2. I’m also hoping to reduce the memory overhead in making JSON requests because they are very common. I may also add memory debugging/monitoring APIs to better track how many allocations occur and what size for a section of code.

Upcoming events!

EuroPython 2020

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 Australia 2020

PyConline AU will be an online event, held September 4–6, 2020 – pycon.org.au.

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 and Call for Proposals.

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

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

20200704 is the latest CircuitPython library bundle.

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

3.8.3 is the latest Python release. The latest pre-release version is 3.9.0b4.

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

21,870 thanks!

21,870 THANKS

Adafruit Discord

The Adafruit Discord community, where we do all our CircuitPython development in the open, reached over 21,870 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. 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 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. Join our Discord or post to the forum for any further questions.