, , &

Controlling NeoPixels with asyncio in CircuitPython @circuitpython

Source Node: 1578074

The Cooperative Multitasking in CircuitPython with asyncio guide has a new example that uses asyncio tasks to control a NeoPixel animation. You can change what the animation is doing while it’s running, just by pressing buttons. The code is clean and doesn’t require checking the buttons inside the animation loop.

Check out the new example here, and see the video above.

To use asyncio, you’ll need CircuitPython 7.1.0 or later, which downloadable from circuitpython.org, and the asyncio library, available from the Download Project Bundle link on the example page, the CircuitPython library bundle or from circup.

Source: https://blog.adafruit.com/2022/01/12/controlling-neopixels-with-asyncio-in-circuitpython/

Time Stamp:

More from Adafruit Industries – Makers & hackers & artists & designers and engineers!