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 get started!
MicroPython 1.16 Released
The 1.16 release of MicroPython is now out and includes a new command-line tool called “mpremote”, which is intended to be the main way to remotely control a MicroPython-based device from the command line. It features a serial terminal, filesystem access, support to mount a local directory on the remote device, and a macro language to define custom commands. This tool can be installed from PyPI via “pip3 install mpremote”, and it works on Linux, Windows and Mac. As part of this, improvements were made to pyboard.py including opening serial ports in exclusive mode to more easily manage multiple devices.
In the Python core, OSError exceptions now support the “.errno” attribute, and an option was added to compile MicroPython without error messages to further reduce code size where needed. The REPL was improved so that it does not tab-complete private methods (those starting with underscore, if no underscore has been typed yet), and it also now tab completes built-in module names after “import” is typed.
Several cores for specific processors have been updated and much more.
See the latest release notice on the MicroPython – GitHub.
Python in Visual Studio Code – June 2021 Release
The June 2021 release of the Python Extension for Visual Studio Code is now available. This release includes support for VS Code’s Workspace Trust, Jump-To-Source code with the PyTorch Profiler and completions for dictionary keys with Pylance.
Python in Visual Studio Code – June 2021 Release – Microsoft Devblogs.
Python 3.10 beta 3 is out
Python 3.10 beta 3 is out – Twitter and the Python Mailing List.
CircuitPython speedy keyswitch handling
CircuitPython speedy keyswitch handling – YouTube and Adafruit Blog.
Dan just dropped a new PR with our event-based key switch vector/matrix handling all done in the CircuitPython core which will make keyboard projects a lot easier and a TON faster. Matrix/vector scanning is now done in a background interrupt and can handle all the work for you and emit key press/release events. Here I’ve got it on our Macropad, which has 12 keys – one on each GPIO so it’s a ‘vector’ keypad. The code is now twice as fast since we’re no longer spending 4ms just for checking whether switches are pressed!
CircuitPython Deep Dive Stream with Scott Shawcroft
Scott took a well deserved vacation this past week and will be back with a new Deep Dive Friday.
You can see past videos on the Adafruit YouTube channel under the Deep Dive playlist – YouTube.
News from around the web!
How I monitor my greenhouse with CircuitPython and open source tools – keep track of your greenhouse’s temperature, humidity, and ambient light using a microcontroller, sensors, Python, and MQTT – opensource.com and Twitter.
Driving multiple independent SSD1306 I2C OLED displays from CircuitPython via FET hackery to give an “enable” pin for each display. This is on an Adafruit QTPy RP2040 – Twitter.
Make: Boards Guide Review: Adafruit ItsyBitsy RP2040 – Make and Twitter.
An edge lit HACK sign powered by CircuitPython and Adafruit Circuit Playground Bluefruit board. Pick your color and animation via app – Twitter.
Create an FPGA-based IoT application using Python and Adafruit IO – rs-online, Diligent and Twitter.
FIDI: a tiny board for fast prototyping with CircuitPython, featuring a ATSAMD21 microcontroller, terminal blocks and a qwiic/STEMMA QT connector – Tindie and Twitter.
I bought this shadow box pattern from Alex Fox on Etsy. Added a NeoPixel strip inside and a Circuit Playground Bluefruit running CircuitPython to set colors and brightness. Animations, too – Twitter.
Update on the Python Software Foundation Executive Director – PSF Blog.
A giant KeyCrappie printed in Prusament Viva La Bronze with a transparent cap and an Adafruit QT Py inside. It runs CircuitPython which powers a small NeoPixel ring to create a fun little nightlight – Twitter.
A capacitor tester made with an Adafruit Feather microcontroller running CircuitPython and a multimeter – Twitter.
Testing Oak Dev Tech PixelLeaf boards by running LED animations from CircuitPython – Twitter Thread.
Raspberry Pi Pico – Using CircuitPython and the Mu Editor for Beginners – YouTube.
MicroPython Resources – a curated list of awesome MicroPython libraries, frameworks, software and resources – Soledad and Twitter.
What is Embedded Python? Discusses Python on hardware including CircuitPython and MicroPython. It then goes through building a game on a BBC micro:bit – Real Python and Twitter.
Teaching Python on the Raspberry Pi 400 at the public library – Adafruit Blog and Opensorce.com.
Making a Secure Communication Terminal (SCT) with MicroPython and RasPi Pico – homofaciens.de.
How to Make an Instagram Bot With Python and InstaPy – Real Python and Twitter.
Deepnote- a new kind of data science notebook. Jupyter-compatible with real-time collaboration and running in the cloud – Deepnote.
A Deepnote example – Time to sunburn – Deepnote.
Second year calculus done entirely in PYTHON: No pencil or paper is required – YouTube and Twitter.
Nuitka is a Python compiler written in Python. It’s fully compatible with Python 2.6, 2.7, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, and 3.9. You feed it your Python app, it does a lot of clever things, and spits out an executable or extension module – GitHub.
FX – a command-line tool and terminal JSON viewer – GitHub.
Encrypt and decrypt a string using Python using the passlib library – Twitter.
Comparison of Python HTTP clients – the best Python HTTP clients for 2021 – ScrapingBee and Twitter.
Fennel, a programming language that brings together the speed, simplicity, and reach of Lua with the flexibility of a lisp syntax and macro system – Adafruit Blog and Fennel Website.
When and how to evaluate Python annotations – lwn.net.
How to troubleshoot memory problems in Python – Innovation Labs.
PyDev of the Week: James Murphy on Mouse vs Python
CircuitPython Weekly Meeting for July 6th, 2020 (notes) on YouTube
#ICYDNCI What was the most popular, most clicked link, in last week’s newsletter? Tom’s Hardware Best RP2040 Boards 2021.
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 no new boards added, but several are in development.
Looking to add a new board to CircuitPython? It’s highly encouraged! Adafruit has four guides to help you do so:
New Learn Guides!
Adafruit Slider Trinkey from Kattni
CircuitPython Project Bundle
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.
Click the button to download the Project Bundle zip.
Open the Project Bundle zip to find the example code, all necessary libraries, and, if available, any images, sounds, etc.
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 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 319!
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!
I’ve mostly finished the new CircuitPython
keypad module, which scans keys or buttons in the background and reports the results. Currently it supports key-per-pin, matrix keypads, and keys attached to a shift register.
I’ll get back to working the CircuitPython 7.0.0 issue backlog in the coming weeks.
Camera work continues! I have started implementing the CircuitPython module for configuring OV2640 cameras. So far, it is able to set up the camera in 160×120 mode and capture the test pattern image as well as live images.
Next up, I need to fix the code so that other resolutions work as well. It should be possible to do somewhat higher resolution modes on RP2040 boards—There’s enough memory for 320×240, but only with some tricks to optimize and reduce memory usage. 240×240 should be usable, depending how much additional code you need to load.
This week I published the Slider Trinkey guide. It has everything you need to get started with your Slider Trinkey, including CircuitPython and Arduino examples. Check it out if you picked up a Slider Trinkey and want to get going with slide potentiometer fun.
We completed the move on all the CircuitPython libraries to the
main default branch. This means that anyone who has previously contributed to a library needs to update their setup. So, to that end, I updated the Contribute to CircuitPython with Git and GitHub guide with a Starting Over Fresh page that covers the easiest way to get your setup in line with the new
I started the QT2040 Trinkey guide as well, so keep an eye out for that coming soon.
This past week, I found a great workaround to an issue that has been plaguing CircuitPython Libraries on the Raspberry Pi ever since it was supported. One of the things the Linux operation system does is it will automatically de-assert the Chip Enable lines on the SPI bus. What we have previously recommended for people to do is to not use the CE0 and CE1 lines if it causes a conflict, which it does on certain chipsets. However on some boards such as the PiTFT, they are hardwired to use the CE0 and CE1 lines. The workaround that I figured out involves reassigning the Chip Enable lines in the device tree overlay to unused GPIO pins so that when the lines are de-asserted, they don’t interfere with the SPI communications. I wrote a script to handle this automatically and updated the SPI Sensors & Devices page in the CircuitPython on Linux and Raspberry Pi guide.
EuroPython, the largest conference for the Python programming language in Europe, will be held online July 26 – August 1, 2021. More information at https://ep2021.europython.eu/
PyOhio 2021 is a free event on July 31, 2021 – PyOhio.org via Twitter.
PyConline AU will be held 10-12 September, 2021 – pyconlineau
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.
CircuitPython’s stable release is 6.3.0 and its unstable release is 7.0.0-alpha.3. New to CircuitPython? Start with our Welcome to CircuitPython Guide.
20210619 is the latest CircuitPython library bundle.
v1.16 is the latest MicroPython release. Documentation for it is here.
3.9.5 is the latest Python release. The latest pre-release version is 3.10.0b3.
2,476 Stars Like CircuitPython? Star it on GitHub!
Call for help – Translating CircuitPython is now easier than ever!
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 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.
Job of the Week
Sheet metal enclosure CAD work – Circuit Dojo – Adafruit Jobs Board.
The Adafruit Discord community, where we do all our CircuitPython development in the open, reached over 29,623 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
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
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.