adafruit_ws2801 - WS2801 LED pixel string driver

  • Author(s): Damien P. George, Limor Fried & Scott Shawcroft, Kevin J Walters
class adafruit_ws2801.WS2801(clock, data, n, *, brightness=1.0, auto_write=True)

A sequence of WS2801 controlled LEDs.

Parameters:
  • clock (Pin) – The pin to output dotstar clock on.
  • data (Pin) – The pin to output dotstar data on.
  • n (int) – The number of LEDs in the chain.
  • brightness (float) – The brightness between 0.0 and (default) 1.0.
  • auto_write (bool) – True if the dotstars should immediately change when set. If False, show must be called explicitly.

Example for Gemma M0:

import adafruit_ws2801
import time
import board

darkred = 0x100000

with adafruit_ws2801.WS2801(board.D2, board.D0, 25, brightness=1.0) as pixels:
    pixels[0] = darkred
    time.sleep(2)
brightness

Overall brightness of the pixel

deinit()

Blank out the DotStars and release the resources.

fill(color)

Colors all pixels the given *color*.

show()

Shows the new colors on the pixels themselves if they haven’t already been autowritten.

The colors may or may not be showing after this function returns because it may be done asynchronously.