The new RP2040 microcontroller from Raspberry Pi Foundation has a powerful feature: the PIO module, a sort of accelerated I/O processor.
In this guide, you will learn how you can use CircuitPython and PIO together to drive 8 separate NeoPixel LED strands using just 3 GPIO pins and a 74HC595 Shift Register.
One advantage of driving your NeoPixel LEDs this way is that less time is spent actually sending the pixel data to the LEDs—It is about 7.5x faster to show()
your NeoPixels with the parallel method. Depending on your project, having parallel strips as opposed to chained strips can also make for better wiring.
Mostly, this guide is just a cool way to show off some of the capabilities of PIO itself. When it comes to wiring up NeoPixels, especially lots of them, check out some in-depth information in the UberGuide including learning about level-shifting and powering them.
Benchmark
The numbers below compare the speed of the two methods of refreshing NeoPixels, the traditional with a single 960-pixel chain, or 8 independent 120-pixel strands thanks to using PIO. It excludes the time to actually update animations on the strips, so it is a "best case" scenario.
960 pixels, 100 refreshes Neopixel show(): 2.93s, 34.1 FPS, 32757 pixels/second NeoPIO show(): 0.43s, 232.7 FPS, 223418 pixels/second
You can make this project with anywhere from 2 to 8 NeoPixel LED strands. Each strand should be the same length.
Text editor powered by tinymce.