adafruit_ws2801
- WS2801 LED pixel string driver¶
Author(s): Damien P. George, Limor Fried & Scott Shawcroft, Kevin J Walters
- class adafruit_ws2801.WS2801(clock: Pin, data: Pin, n: int, *, brightness: float = 1.0, auto_write: bool = 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)