Adafruit NeoPXL8 Arduino Library
8-way concurrent DMA NeoPixel library for SAMD21, SAMD51 and

RP2040 microcontrollers.


Adafruit_NeoPXL8 is an Arduino library that leverages hardware features unique to some Atmel SAMD21 and SAMD51 microcontrollers, plus the Raspberry Pi RP2040 chip, to communicate with large numbers of NeoPixels with very low CPU utilization and without losing track of time. It was originally designed for the Adafruit Feather M0 board with NeoPXL8 FeatherWing interface/adapter, but may be applicable to other situations (e.g. Arduino Zero, Adafruit Metro M0, etc., using logic level-shifting as necessary). A different FeatherWing with pinout specific to the Feather M4 is also available.

NeoPXL8 FeatherWing M0: NeoPXL8 FeatherWing M4:

Because the SAMD21 does not provide GPIO DMA, the code instead makes use of the "pattern generator" peripheral for its 8 concurrent outputs. Due to pin/peripheral multiplexing constraints, most outputs are limited to SPECIFIC PINS or provide at most ONE ALTERNATE pin selection. See the example code for details. The payoff is that this peripheral handles the NeoPixel data transfer while the CPU is entirely free to render the next frame (and interrupts can remain enabled – millis()/micros() don't lose time, and soft PWM (for servos, etc.) still operate normally).

Additionally, NeoPXL8 has nondestructive brightness scaling...unlike classic NeoPixel, getPixelColor() here always returns the original value as was passed to setPixelColor().

RP2040 support requires Philhower core (not Arduino mbed core). Also on RP2040, pin numbers passed to constructor are GP## indices, not necessarily the digital pin numbers silkscreened on the board.

0/1 bit timing does not precisely match NeoPixel/WS2812/SK6812 datasheet specs, but it seems to work well enough. Use at your own peril.

Some of the more esoteric NeoPixel functions are not implemented here, so THIS IS NOT A 100% DROP-IN REPLACEMENT for all NeoPixel code right now.

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!


This library depends on Adafruit_NeoPixel and (for SAMD chips) Adafruit_ZeroDMA being present on your system. Please make sure you have installed the latest versions before using this library.


Written by Phil "Paint Your Dragon" Burgess for Adafruit Industries.


MIT license, all text here must be included in any redistribution.