- Adafruit Industries, Unique & fun DIY electronics and kits SparkFun Qwiic Multiport ID: 4861 - Qwiic, or STEMMA QT, is a very efficient way to quickly prototype an idea, but a lot of Qwiic/Stemma QT driver boards only have one port, and devices have two ports but that's only good for chaining.
- In my list of serial devices, I also have an Arduino Uno currently connected, so my ESP8266 is COM17. COM1 is almost always an internal Windows port, so your device will never be COM1! Go back to your IDE and click Tools Board Adafruit Huzzah ESP8266 if you are using the Adafruit board.
- ADAFRUIT Industries 954 USB-to-TTL Serial Cable, Raspberry PI (1 Piece). Serial output, etc. But it's rare for a computer to have a serial port anymore. This is a USB to TTL serial cable, with a FTDI FT232RL usb/serial chip embedded in the head. It has a 6-pin socket at the end with 5V power and ground, as well as RX, TX, RTS and CTS at 3V.
Adafruit Industries is an open-source hardware company based in New York City.It was founded by Limor Fried in 2005. The company designs, manufactures and sells a number of electronics products, electronics components, tools and accessories. These devices use SPI to communicate Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Written by Dean Miller for Adafruit Industries.
CircuitPython data descriptor classes to represent hardware registers on I2C and SPI devices.
This library provides a variety of data descriptor class for AdafruitCircuitPython that makes it reallysimple to write a device drivers for a I2C and SPI register based devices. Datadescriptors act like basic attributes from the outside which makes using themreally easy to use.
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem.This is easily achieved by downloadingthe Adafruit library and driver bundle.
Installing from PyPI
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally fromPyPI. To install for current user:
To install system-wide (this may be required in some cases):
To install in a virtual environment in your current project:
Creating a driver
Creating a driver with the register library is really easy. First, import theregister modules you need from the available modules:
Next, define where the bit is located in the device’s memory map:
Lastly, we need to add an i2c_device member of type I2CDevicethat manages sharing the I2C bus for us. Make sure the name is exact, otherwisethe registers will not be able to find it. Also, make sure that the i2c deviceimplements the busio.I2C interface.
Thats it! Now we have a class we can use to talk to those registers:
Adding register types
Adding a new register type is a little more complicated because you need to becareful and minimize the amount of memory the class will take. If you don’t,then a driver with five registers of your type could take up five times moreextra memory.
First, determine whether the new register class should go in an existing moduleor not. When in doubt choose a new module. The more finer grained the modulesare, the fewer extra classes a driver needs to load in.
Here is the start of the RWBit class:
The first thing done is writing an RST formatted class comment that explains thefunctionality of the register class and any requirements of the register layout.It also documents the parameters passed into the constructor (__init__) whichconfigure the register location in the device map. It does not include thedevice address or the i2c object because its shared on the device class instanceinstead. That way if you have multiple of the same device on the same bus, theregister classes will be shared.
In __init__ we only use two member variable because each costs 8 bytes ofmemory plus the memory for the value. And remember this gets multiplied by thenumber of registers of this type in a driver! Thats why we pack both theregister address and data byte into one bytearray. We could use two byte arraysof size one but each MicroPython object is 16 bytes minimum due to the garbagecollector. So, by sharing a byte array we keep it to the 16 byte minimum insteadof 32 bytes. Each memoryview also costs 16 bytes minimum so we avoid them too.
Another thing we could do is allocate the bytearray only when we need it. Thishas the advantage of taking less memory up front but the cost of allocating itevery access and risking it failing. If you want to add a version of Foo thatlazily allocates the underlying buffer call it FooLazy.
Ok, onward. To make a data descriptorwe must implement __get__ and __set__.
As you can see, we have two places to get state from. First, self stores theregister class members which locate the register within the device memory map.Second, obj is the driver class that uses the register class which must bydefinition provide a I2CDevice compatibleobject as i2c_device. This object does two thing for us:
- Waits for the bus to free, locks it as we use it and frees it after.
- Saves the device address and other settings so we don’t have to.
Note that we take heavy advantage of the start and end parameters to thei2c functions to slice the buffer without actually allocating anything extra.They function just like self.buffer[start:end] without the extra allocation.
Thats it! Now you can use your new register class like the example above. Justremember to keep the number of members to a minimum because the class may beused a bunch of times.
Contributions are welcome! Please read our Code of Conductbefore contributing to help this project stay welcoming.
For information on building library documentation, please check out this guide.
Release historyRelease notifications RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size adafruit-circuitpython-register-1.9.4.tar.gz (32.9 kB)||File type Source||Python version None||Upload date||Hashes|
Hashes for adafruit-circuitpython-register-1.9.4.tar.gz
Read this email in your browser, click here!
This is alpha release number 1 of CircuitPython 5.0.0. Alpha releases are meant for testing. Download this release from circuitpython.org. Use the latest stable 4.x release when first starting with CircuitPython. When you find a bug please check the current known issues and file an issue if something isn’t already known. 5.0.0 is the latest major revision of CircuitPython. It features many improvements and enhancements to
displayio, including grayscale and e-paper displays, extensive additions and changes to BLE support, and PWM audio support.
ADABOX last week to sign up for the Halloween box!
This is the last week to sign up for the ADABOX 13, Halloween box. All we can say is that it for-sure has Python on hardware and it will be scary 🙂 JOIN US – ADABOX.COM.
Meet Device Simulator Express
Device Simulator Express, a Microsoft Garage project, built by Garage interns, makes it easier to program the Adafruit Circuit Playground Express in Python / CircuitPython, with or without a physical device!
“This summer, 16 groups of Garage interns tackled interesting engineering challenges ranging from making apps more accessible to VR solutions for cybersecurity. One of them was sponsored by the Python Tools for AI team and electronics paragon Adafruit. They set out to make programming embedded solutions for IoT devices simpler and more available to a broader audience. Device Simulator Express, a Microsoft Garage project, is a Visual Studio code extension that enables developers to program the Adafruit Circuit Playground Express in CircuitPython, with or without a physical device.”
Visit the Microsoft Garage blog & try it out!
CircuitPython snakes its way to Gamebuino
Soru’s developer blog post about porting CircuitPython to the Gamebuino, and its GitHub repo.
“Soru had already previously heard of MicroPython 1, a python port designed for embedded platform to “fit and run within just 256k of code space and 16k or RAM”. Sounds perfect for the gamebuino, right? So, let’s see if someone already made a port for the Arduino Zero. Why that arduino? Its hardware from a chipset perspective is the same as the gamebuino meta, and it is pretty popular, so there bound to be someone who ported it! And yes, as it turns out adafruit forked MicroPython, creating CircuitPython, and, look and behold, it already has official ports to atmel-samd based bored – including the Arduino Zero!”
We are hoping the team at Gamebuino merges the changes into mainline and/or pull requests, which will make things easier and better for them and the community together!
MicroPython snakes its way to the cover of micro:mag!
This issue’s cover feature is “Explore MicroPython”. There are lots of MicroPython content in this issue, most of the code is written in MicroPython. For the cover feature, you’ll find some information about MicroPython, tips on which editor to use, useful links/guides and 10 MicroPython mini projects for you to try! – Download PDF.
CircuitPython powered USB hub now in production!
With the campaign successful and concluded, the efforts have now transitioned to preparing for and starting production, read all about it – Crowd Supply.
Preparing Graphics for E-Ink Displays
Back in the early Macintosh computer days, when the Earth’s crust was still cooling, getting photos and artwork to look presentable on these computers’ 1-bit monochrome displays was something of an art form.
Much of that know-how has fallen by the wayside as screens improved…but with wafer-thin, ultra-low-power 2- and 3-color E-Ink displays appearing everywhere now, a refresher in those techniques is suddenly relevant again, more so with CircuitPython and all the supported displays – learn.adafruit.com & check out all the latest photos on Flickr.
CircuitPython powered 3D printed LoRa remote control
back7.co writes –
“I just wrapped up another monthly project and I thought you all would like it. It’s a simple LoRa (long range wireless) remote control, intended as a tool to help me do some LoRa-based robots. More on LoRa here. Inside is a simple 2-axis analog joystick and a trigger I found in my parts bin. I think it’s from McMaster Carr but I couldn’t find it. The board inside is the 900Mhz LoRa M0 Feather from Adafruit running CircuitPython, and there’s a micro-usb connector on the end. The Feather shows up as a USB drive and the code runs live & reloads whenever I save the file, so it’s a pretty easy way to troubleshoot as I go. More on CircuitPython here. The code is simple and in early form, but is on Github here. I designed all the parts in Tinkercad, as I am still far more comfortable there than in Fusion 360. The files on Tinkercad are here but the build list and parts are also listed on my Thingiverse entry here. I’m doing about one project a month or so, and I’m documenting the progress on Instagram through neat photos. I hope you like it! You can see the full series of photos on my Instagram here.”
CircuitPython snakes its way to DragonCon!
Disney Villain armor – Ursula 3D Printed armor. LEDs are NeoPixels and a Gemma M0 programmed in CircuitPython – Twitter.
What are Bryan, Dan, and Melissa up to?
Download Adafruit Industries Port Devices Driver Download
Bryan finished testing Kattni’s TLV493D breakout and wrote the CircuitPython driver. This was an interesting one, as there are no individually addressable registers like most I2C sensors. Instead you have to read bytes from the sensor until you get the information you need, and the same on writes. Next up, Bryan is working on the guide for the upcoming Airlift BitsyWing.
Dan has CircuitPython BLE HID working on MacOS, Windows, Linux, and Chromebooks. It does not yet work on iOS, for unknown reasons, so Dan is debugging that with help from Thach, our resident BLE expert. Dan is also revising the bleio API so that Services, Characteristics, and Descriptors are added to their parent objects when they are created. And last up, Dan is adding compilation options to CircuitPython so that a custom build can enable and disable individual USB and USB HID devices. This takes a step toward user-defined HID devices.
Melissa is writing a guide on installing TensorFlow Lite on the Raspberry Pi 4. She has it working with Object Detection using the Raspberry Pi Camera and a PiTFT.
Feather takes flight on the Kea Feather
The Kea Feather has built in WiFi and BLE connectivity. Kea is based on the Adafruit Feather pinout for compatibility with a huge selection of ‘wing’ boards for adding sensors and subsystems. The powerful STM32F411 micro on Kea supports programming it with .Net MicroFramework, GHI TinyCLR, nanoMF and MicroPython, as well as native programming – ingenuitymicro.com.
ESP32-S2 low-power 2.4 GHz Wi-Fi System-on-Chip
56 pin ESP32-S2 – Twitter.
The most recent ESP newsletter arrived as we were finishing this newsletter, here’s a link and more about the new ESP32-S2! AND a datasheet! – PDF.
“ESP32-S2 is a low-power 2.4 GHz Wi-Fi System-on-Chip (SoC) solution. With its state-of-the-art power and RF performance, this SoC is an ideal choice for a wide variety of application scenarios relating to the Internet of Things (IoT), wearable electronics and Smart Home. ESP32-S2 includes a Wi-Fi subsystem that integrates a Wi-Fi MAC, Wi-Fi radio and baseband, RF switch, RF balun, power amplifier, low noise amplifier (LNA), etc. Espressif’s new SoC is fully compliant with the IEEE 802.11b/g/n protocol and offers a complete Wi-Fi solution. At the core of this SoC is an Xtensa® 32-bit LX7 CPU that operates at a maximum of 240 MHz. The SoC supports application development, without the need for a host MCU. The on-chip memory includes 320 KB SRAM and 128 KB ROM. It also supports a number of external SPI/QSPI/OSPI flash and SRAM chips for more memory space. With its multiple low-power modes, ESP32-S2 is designed for ultra-low-power performance. Its fine-grained clock gating, dynamic voltage and frequency scaling, as well as the adjustable output of its power amplifier contribute to an optimal trade-off between communication range, data rate and power consumption. The device provides a rich set of peripheral interfaces, including SPI, I2S, UART, I2C, LED PWM, LCD, camera, ADC, DAC, touch sensor, temperature sensor, as well as 43 GPIOs. It also includes a full-speed USB On-The-Go (OTG) interface which enables USB communication at all times. ESP32-S2 has several dedicated hardware security features. Cryptographic accelerators are integrated, thus providing AES, SHA and RSA algorithms. Additional hardware security features are provided by the RNG, HMAC and Digital Signature modules, as well as flash encryption and secure boot signature verification. These characteristics allow the device to meet stringent security requirements.”
Downloads are available from circuitpython.org! This site makes it much easier to select the correct file and language for your board. The downloads page is here. Here are just some of the latest boards added! There are 74+ boards!
Snekboard by keithp.com.
Circuit Playground Bluefruit by Adafruit.
HalloWing M4 Express by Adafruit.
MONSTER M4SK by Adafruit.
News from around the web!
Nice case for the PyPortal via Twitter – GitHub.
Introduction to CircuitPython and the Circuit Playground Express – GitHub.
A personal wristband card10badge for the ccccamp2019 and beyond… card10 is pronounced cardio, 10 is binary for 2. It runs MicroPython. This is an interesting quote from Hackaday:
“…MicroPython is the future for embedded electronics. We will always need embedded engineers, but in the same way that electronic design trended away from analog and toward digital, engineer-focused electronics will trend toward higher level languages and I think Python has already managed to vanquish its challengers.”
Spherical POV (Persistence Of Vision) device using WiFi and BLE – Home Made Garbage.
Robo HAT MM1 is almost here! – Twitter.
Micropython API to C libraries, via Hackaday – littlevgl.com.
Novena Five-Year Anniversary, there are about 50 units left of the open-source laptop, last chance to buy one – Crowd Supply.
Recreate Super Sprint’s top-down racing in Python – Raspberry Pi.
Industrial and commercial applications are becoming the biggest market for the Raspberry Pi – IEEE Spectrum.
M5Stick-V object recognition training service – v-training.m5stack.com.
A curated list of public TEE resources for learning how to reverse-engineer and achieve trusted code execution on ARM devices – GitHub.
exFAT in the Linux kernel? Yes! – Microsoft open source blog, and spec.
Python Community Interview With Marlene Mhangami – Real Python. Marlene is a passionate Pythonista who is not only using tech to facilitate social change and empower Zimbabwean women but is also the chair of the very first PyCon Africa.
Python 3.8.0b4 is now available for testing – Python.org.
Building an Image Hashing Search Engine with VP-Trees and OpenCV – PyImageSearch.
Kiwi PyCon X 2019, Wellington – YouTube.
PyDev of the Week: Katherine Kampf on Mouse vs Python.
Python IDE and Code Editors – Code Infinite.
#ICYDNCI What was the most popular, most clicked link, in last week’s newsletter? CircuitPython snakes its way to Micro Center!
Made with Mu
More previews for the upcoming CircuitPython and Mu book! Twitter, and STEAM Tokyo.
Why 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
TLV493D STEMMA. This TLV493D is a low cost I2C triple-axis magnetometer, specifically designed for joysticks but could be used for other magnetic sensing! Kattni did the board layout for this one, and Bryan is writing the CircuitPython library.
BrainCraft board preview! – YouTube.
The PA1010D miniature GPS with I2C interface. This STEMMA board is this lil 1”x1” GPS board, with UART and I2C support. On the back is the RTC coin battery. The I2C makes it easy to chain an OLED onto the end, and this one is displaying the NMEA sentences. Working great so far! – YouTube.
New Learn Guides!
Explore Magic Cap, a smartphone OS from a decade before the iPhone from Matthew Goodrich. You’re saying this is not Python related?? We are doing a lot of these guides of retro devices to learn from the best as we add more UI and features to CircuitPython.
PyPortal IoT Plant Monitor with Google Cloud IoT Core and CircuitPython from Brent Rubell
Getting Started with Braille Output for CircuitPython REPL from Isaac Wellish
Updated Guides – Now With More Python!
You can use CircuitPython libraries on Raspberry Pi! We’re updating all of our CircuitPython guides to show how to wire up sensors to your Raspberry Pi, and load the necessary CircuitPython libraries to get going using them with Python. We’ll be including the updates here so you can easily keep track of which sensors are ready to go. Check it out!
Keep checking back for more updated guides!
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 drivers, download the Adafruit CircuitPython Library 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! Interested in helping with current libraries? Check out this GitHub issue on CircuitPython for an overview of the State of the CircuitPython Libraries, updated each week. We’ve included open issues from the library issue lists, 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. Feel free to contact Kattni (@kattni) with any questions.
You can check out this list of all the CircuitPython libraries and drivers available.
The current number of CircuitPython libraries is 178!
Here’s this week’s new CircuitPython 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:
PYCON UK 2019 – Cardiff City Hall, Friday 13th to Tuesday 17th September. PyCon UK is back at Cardiff City Hall, for five days of talks, workshops and collaboration. The conference also features a young coders’ day, themes dedicated to science and education, and numerous Python-related events – PyCon UK.
Bring your Python hardware to PyCon UK
Here’s a call for PyCon UK attendees to bring their Python on Hardware projects to an open session.
We had a similar session one year and people brought a lot of cool projects (including plenty of CircuitPython!) so I’m really looking forward to see as many people as possible bringing their cool projects again this year 🙂 – Thanks Carlos! Twitter
October is Open Hardware Month @ Open Source Hardware Association.
“October is Open Hardware Month! Check out the Open Hardware Month website. Host an event, find a local event, or certify your hardware to support Open Source Hardware. We are providing resources and asking you, the community, to host small, local events in the name of open source hardware. Tell us about your October event by filling out the form below. Your event will be featured on OSHWA’s Open Hardware Month page (provided you have followed OSHWA’s rules listed on the “Do’s and Don’ts” page).”
Read more, Tweet for speakers in 2020, and Open Hardware Month @ http://ohm.oshwa.org/
micro:bit Live 2019 is coming to BBC MediaCityUK, Greater Manchester, England on October 4-5. This will be the very first annual gathering of the global micro:bit community of educators and partners – micro:bit.
PyCon DE & PyData Berlin, Germany // October 9 – 13 2019. Main conference, 3 days of talks and workshops
More than 100 sessions dedicated to PyData (artificial intelligence, machine learning, ethics…) and Python topics (programming, DevOps, Web, Django…) – de.pycon.org.
Hackaday Superconference is November 15th, 16th, and 17th in Pasadena, California USA. The Hackaday Superconference is returning for another 3 full days of technical talks, badge hacking, and hands-on workshops: Eventbrite & hackaday.io
CircuitPython’s stable release is 4.1.0 and its unstable release is 5.0.0-alpha.1. New to CircuitPython? Start with our Welcome to CircuitPython Guide.
20190830 is the latest CircuitPython library bundle.
v1.11 is the latest MicroPython release. Documentation for it is here.
3.7.4 is the latest Python release. The latest pre-release version is 3.8.0b4.
1372 Stars Like CircuitPython? Star it on GitHub!
Call for help – CircuitPython messaging to other languages!
We recently posted on the Adafruit blog about bringing CircuitPython messaging to other languages, one of the exciting features of CircuitPython 4.x is translated control and error messages. Native language messages will help non-native English speakers understand what is happening in CircuitPython even though the Python keywords and APIs will still be in English. If you would like to help, please post to the main issue on GitHub and join us on Discord.
We made this graphic with translated text, we could use your help with that to make sure we got the text right, please check out the text in the image – if there is anything we did not get correct, please let us know. Dan sent me this handy site too.
jobs.adafruit.com – Find a dream job, find great candidates!
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.
The Adafruit Discord community, where we do all our CircuitPython development in the open, reached over 13,835 humans, thank you! Join today! https://adafru.it/discord
Discord now offers “server boosts”. We have 12 on our server (level 2) and if we get to 50 boosts, we get to level 3 and some other good features for the community: +100 emojis for a total of 250, 384 Kbps audio, vanity URL, 100 mb uploads for all members (and all the things we have now, like the server banner). Stop by and boost! https://adafru.it/discord.
ICYMI – In case you missed it
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, 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.
Adafruit Industries Llc Ports
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.
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.