adafruit_neopxl8 - Neopixel strip driver using RP2040’s PIO

  • Author(s): Damien P. George, Scott Shawcroft, Carter Nelson, Roy Hooper, Jeff Epler

adafruit_neopxl8.GRB = 'GRB'

Green Red Blue

adafruit_neopxl8.GRBW = 'GRBW'

Green Red Blue White

class adafruit_neopxl8.NeoPxl8(data0, n, *, num_strands=8, bpp=3, brightness=1.0, auto_write=True, pixel_order=None)

A sequence of neopixels.

Parameters:
  • data0 (Pin) – The first of 8 data registers, in GPIO order

  • n (int) – The total number of neopixels. Must be a multiple of the number of strands.

  • num_strands (int) – The number of neopixels in each strand.

  • bpp (int) – Bytes per pixel. 3 for RGB and 4 for RGBW pixels.

  • brightness (float) – Brightness of the pixels between 0.0 and 1.0 where 1.0 is full brightness

  • auto_write (bool) – True if the neopixels should immediately change when set. If False, show must be called explicitly.

  • pixel_order (str) – Set the pixel color channel order. GRB or GRBW is set by default, depending on bpp.

Example for Adafruit Feather RP2040 Scorpio, sets 240 LEDs in 8 strands to faint red:

pixels = adafruit_neopxl8.NeoPxl8(board.NEOPIXEL0, 8*30, num_strands=8, auto_write=False)
pixels.fill(0x010000)
pixels.show()
show()

Shows the new colors on the pixels themselves if they haven’t already been autowritten. Note that with NeoPxl8 the show operation takes place in the background; when this routine returns, the new pixel data has just started to be written but your Python code can continue operating in the foreground, updating pixel values or performing other computations.

fill(color)

Colors all pixels the given *color*.

brightness

Overall brightness of the pixel (0 to 1.0)

deinit()

Blank out the neopixels and release the state machine.

property n

The total number of neopixels in all strands (read-only)

property num_strands

The total number of neopixels in all strands (read-only)

adafruit_neopxl8.RGB = 'RGB'

Red Green Blue

adafruit_neopxl8.RGBW = 'RGBW'

Red Green Blue White