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

View this email in your browser.

Welcome to the latest Python on 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 make it so!

PyLeap App Goes into Official Beta Test

PyLeap

PyLeap

PyLeap is an app for iOS and iPadOS. It allows you to collect complete projects from the Adafruit Learn System and transfer them directly to your Circuit Playground Bluefruit without opening a code editor or connecting to a computer. Send files and libraries directly to your Bluefruit device! – Adafruit Blog.

You can read more in the official guide on the Adafruit Learning System: PyLeap App

The app may be downloaded via https://adafru.it/pyleap

The following guides are now up on the Adafruit Learning System to get you started with PyLeap:

Note: An Android version is anticipated, but there is no release date at present.

CircuitPython 7.1.0 Beta 3 is Available

CircuitPython 7.1.0 Beta 3

CircuitPython 7.1.0-beta.3 is available, the fourth beta release for CircuitPython 7.1.0. It is relatively stable, but contains issues to address for 7.1.0. Note beta.2 was short-lived due to a regression. The main addition to this beta over the last is addition of Non-OS (“bare metal”) versions of CircuitPython for some Broadcom-based Raspberry Pi single board computers – GitHub.

Notable additions to 7.1.0 since 7.0.0:

  • Initial port for Raspberry Pi Broadcom-based boards.
  • keypad.Events now include timestamps.
  • The Espressif port now provides I2CPeripheral, WiFi monitor mode, ESP32-C3 support, and ParallelImageCapture.
  • bitmaptools: dithering and alphablend are new.
  • Preliminary support for asyncio is included. Use the CircuitPython asyncio library.
  • gifio.GifWriter is new.
  • HID now provides boot device and feature report support.
  • rotaryio now allows setting the divisor of counts per transition.
  • The SAMD port now provides watchdog and alarm with sleep.
  • The STM port now provides STM32L4R5 support.
  • MicroPython 1.17 has been merged in.
  • Russian translation.

Boston College Students Demonstrate their Final Projects Using CircuitPython

Professor John Gallaugher teaches an excellent class on using microcontrollers to non-engineering students. For the students’ final projects, they built a number of devices using CircuitPython in innovative ways. Here are some of the projects as posted on Twitter.

Popcorn

A personal assistant robot named Popcorn – Twitter.

Iron Man Helmet

A 3D printed, motorized Iron Man helmet with a heads-up display on a Raspberry Pi 4 plus Adafruit Crickit HAT running CircuitPython – Twitter.

CircuitPython Fish Feeder

An electronic fish feeder with CircuitPython – Twitter.

A deep dive into Raspberry Pi Zero 2 W power consumption

Raspberry Pi Zero 2 W power consumption

Raspberry Pi Zero 2 W power consumption is measures with various peripherals on and being used and some of those turned off. This is a great baseline for comparing with Bare Metal (No OS) CircuitPython on the board – CNX Software via Twitter.

GitHub Code Search Technology Preview

GitHub Code Search

GitHub is rolling out a technology preview for substantial improvements to searching code on the platform. A survey must be filled out for access. if granted, it’ll be located at https://cs.github.com/. The search index covers more than five million of the most popular public repositories; in addition, you can search private repositories you have access to – GitHub Blog.

CircuitPython Deep Dive Stream with Scott Shawcroft

Deep Dive with Scott

This week, Scott streams his work with CircuitPython on Raspberry Pi (No OS/Bare Metal) and use of NeoPixels.

Note: There will be no new streams from Scott for the next three weeks.

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

CircuitPython Parsec

CircuitPython Parsec

John Park’s CircuitPython Parsec:

Catch all the episodes in the YouTube playlist.

News from the Python Software Foundation

PSF News

Twitter Post

The PSF announced on December 7th that it was the last day for departing director Ewa Jodlowska.

Ewa’s impact on Python & the Python community has been tremendous & will be long-lasting. We love you Ewa!

News from around the web!

Learn Python

Learn Python – Free Python Courses for Beginners – FreeCodeCamp.

CircuitPython Mouse Jiggler

An Adafruit Neo Trinkey and CircuitPython mouse jiggler/mover with touch sensitive on/off button – Twitter.

Snowman matrix

A snowman holiday decoration on an Adafruit MatrixPortal. User-selectable storm/blizzard settings, written in CircuitPython – Twitter.

Stargate

A replica Stargate, powered by an Adafruit QT Py, NeoPixel LEDs, and CircuitPython – Twitter and YouTube.

Loving CircuitPython

Loving CircuitPython. (The) same code running a single board computer and different microcontrollers. Pi 3, Pi Pico, ItsyBitsy RP2040 and ESP32-S2 – Twitter.

EEPROM

Using an EEPROM in CircuitPython to save state information with a Raspberry Pi Pico – Twitter.

Solenoid Driver

An Adafruit perma-proto driver for a pair of tiny solenoids in preparation for a little robot prototype – Twitter.

Mouse Hacking

CircuitPython code to create a mouse jiggler prank, making it difficult for someone using their computer mouse – Twitter and GitHub (not necessarily recommended).

Social Distancing

A social distancing jacket using an ultrasonic sensor and NeoPixels – Twitter and YouTube.

Adafruit Circuit Playground device holder

A 3D printed holder for an Adafruit Circuit Playground device – Twitter.

Mu thanks

Some Chinese students learning Python with Mu say thank you – YouTube.

Interfacing Ultrasonic Sensor HC-SR04

ESP32 MicroPython – Interfacing Ultrasonic Sensor HC-SR04 – site via Twitter.

Christmas display

A Raspberry Pi 3, a Pimoroni Unicorn Hat HD, 19 ESP32s and some MicroPython all in a mill, makes for a fun Christmas display – Twitter.

MicroPython DMA

In the HackSpace lab today, we’re working on getting sounds to play on a Raspberry Pi Pico on MicroPython using DMA – this means the sound plays in the background and doesn’t use any processor overhead – Twitter.

microStudio

microStudio, a free game engine online, now supports 4 programming languages: microScript, Python, JavaScript and Lua – Blog and Site.

Gerrymandering with Python

Detecting and Measuring Gerrymandering with Python – a quick introduction to the declination angle and how it can be a powerful tool for detecting gerrymandering – Towards Data Science.

Sample code for CircuitPython and MicroPython

Using CircuitPython With The Kitronik Motor Driver Boards for Raspberry Pi Pico – Kitronik and YouTube, via Twitter.

Toxicity in OSS

Paper: “Did You Miss My Comment or What?” Understanding Toxicity in Open Source Discussions – GitHub (PDF).

PyDev of the Week: Alex Hall from Mouse vs Python

CircuitPython Weekly Meeting for December 13th, 2021 on YouTube and notes

#ICYDNCI What was the most popular, most clicked link, in last week’s newsletter? Flight Tracker.

Coming soon

I2C Shield

A “shield” board to add I2C breakouts to a Feather or ItsyBitsy size development board, with pins broken out and 2 Qwiic/STEMMA QT connections – Twitter.

CP2012N

Adafruit uses the CP2104 USB-serial converter in a lot of their designs – but it’s hard to get during the shortage(s). The CP2102N is available, and it’s a close replacement, but there are a few small hardware changes needed and the internal EEPROM is different. So, if you just spent 2 days trying to figure out why your CP2104 EEPROM writing code isn’t working and you were dreading having to rewrite the libusb vendor calls, good news! This PR to a fork of a program compiled cleanly and did the job a treat on the Adafruit Raspberry Pi tester, whew – Adafruit Blog.

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 were five 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

Big Key Switches Macro Pad from Noe and Pedro

Nunchuck Controlled Laser Cat Toy from Melissa LeBlanc-Williams

Trinkey True Random Number Generator from Carter Nelson

Adafruit KB2040 by Kattni

CircuitPython Project Bundle

BundleFly

When you get to the CircuitPython code section of an Adafruit Learn Guide, sometimes things can get a bit complicated. You not only have the code you need to upload to your device, but you likely also need to add some libraries that the code requires to run. This involved downloading all the libraries, digging through to find the ones you need, and copying them to your device. That was only the beginning on some projects, as those that include images and/or sound files required further downloading and copying of files. But, not anymore!

Now, with Project Bundles, you can download all the necessary code, libraries and, if needed, asset files with one click! We automatically check which libraries are required for the project and bundle them up for you. No more digging through a huge list of libraries to find the ones you need, or fiddling with looking for other files or dependencies. Download the Project Bundle, copy the contents to your device, and your code will simply work. We wanted to make this the easiest way to get a project working, regardless of whether you’re a beginner or an expert. We’ll also be adding this feature to popular IDEs as an add-on. Try it out with any Circuit Python guide on the Adafruit Learning System. Just look for the ‘Download Project Bundle’ button on the code page.

To download and use a Project Bundle:

In the Learning System – above any embedded code in a guide in the Adafruit Learn System, you’ll find a Download Project Bundle button.

Project Bundle download button

Click the button to download the Project Bundle zip.

Project Bundle zip downloaded

Open the Project Bundle zip to find the example code, all necessary libraries, and, if available, any images, sounds, etc.

Project Bundle unzipped

Simply copy all the files over to your CIRCUITPY drive, and you’re ready to go!

If you run into any problems or bugs, or would like to submit feedback, please file an issue on the Adafruit Learning System Guides GitHub repo.

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

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 have been fixing issues for the CircuitPython 7.1.0 release. I’ve fixed a countio issue on the RP2040, fixed frequencyio.FrequencyIn on SAMD51, fixed Airlift BLE support, and narrowed down an SD card problem that Jeff fixed: I had SD cards that triggered the problem, Jeff did not, and I was able to do a git bisect to determine which code was causing the issue.

Jeff

With a big assist from Dan, I was able to fix a problem with SD cards that I had introduced when improving write speeds. This only affected users of 7.1 beta versions.

I also added board definition files for several ESP32-S3 development boards, which are now in the absolute latest builds.

Kattni

This week I published the core of the KB2040 guide. It still has a few things to add before it’ll be completed, but if you’re looking to get started with your board, check out the guide.

I added a create_and_get_feed function to the CircuitPython Adafruit IO library that combines the get_feed and create_feed functions. It allows you, in one line of code, to attempt to get a feed, and if it doesn’t exist, create it and then get it. It eliminates the need for a try/except block in examples to do the same functionality.

Next up is the NeoSlider guide. Keep an eye out for that coming soon!

Melissa

This past week, I finished my Nunchuck Controlled Laser Cat Toy guide. I made a few tweaks to the source code to allow some cool this. For instance, since the project already had a PWM FeatherWing to control the servos, I updated it so it could change the brightness of the laser by pulsing the on/off line. I then made use of the nunchuck controller to be able to adjust the brightness of the laser just by twisting your wrist and holding down one of the buttons. This project has a lot of potential to take it to the next level and I listed a bunch of ideas that I had considered doing while writing the guide. You can check out the guide here.

The other big thing I did was I fixed a bug in the Web Serial ESPTool that had existed since my refactor and I hadn’t been able to figure out. With several people running into the bug and Kattni finding a way to consistently reproduce the issue, I was able to narrow it down in the code and fix it.

Scott

This week I’ve continued working on the Raspberry Pi port of CircuitPython. I merged in full UART support and included a fix for the Raspberry Pi 4B disk image that prevented it from booting. Next, I started working on full SPI support. I’ve got it compiling and will test it today. After that, I’ll add NeoPixel support.

I also had to tweak the CircuitPython CI to fix an unreliability that I introduced when I optimized the submodule fetch.

Upcoming events!

MicroPython Meetup

The December MicroPython Meetup in Melbourne was pushed due to proximity to the holidays – the next one will be on January 26th – Meetup.

PyCascades 2022

PyCascades is a regional PyCon in the Pacific Northwest, celebrating the west coast Python developer and user community. Our organizing team includes members of the Vancouver, Seattle, and Portland Python user groups. DATES ANNOUNCED! February 5th-6th, 2022 The conference will take place on Saturday and the first half of Sunday, with the post-conference sprints following that on Sunday afternoon. After three amazing in-person conferences and an engaging online conference, we are ready to do it again! – PyCascades 2022.

PyCon US 2022

PyCon US 2022 planning is underway. The team is planning to host the event in person with an online component. April 27, 2022 – May 5, 2022. Head over to the PyCon US 2022 website for details about the conference and more information about the sponsorship program – PyCon Blog.

PyCon IT 2022

PyCon Italia is the Italian conference on Python. Organised by Python Italia, it is one of the more important Python conferences in Europe. With over 700 attendees, the next edition will be June 2-5, 2022 – Ticket Registration.

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

20211213 is the latest CircuitPython library bundle.

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

3.10.1 is the latest Python release. The latest pre-release version is 3.11.0a3.

2,694 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, Micro Center, Raspberry Pi and more.

32,193 thanks!

32,193 THANKS

Adafruit Discord

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

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.