adafruit_dotstar - DotStar strip driver

  • Author(s): Damien P. George, Limor Fried & Scott Shawcroft
class adafruit_dotstar.DotStar(clock, data, n, *, brightness=1.0, auto_write=True, pixel_order=(2, 1, 0))[source]

A sequence of dotstars.

Parameters:
  • clock (Pin) – The pin to output dotstar clock on.
  • data (Pin) – The pin to output dotstar data on.
  • n (int) – The number of dotstars in the chain
  • brightness (float) – Brightness of the pixels between 0.0 and 1.0
  • auto_write (bool) – True if the dotstars should immediately change when set. If False, show must be called explicitly.
  • pixel_order (tuple) – Set the pixel order on the strip - different strips implement this differently. If you send red, and it looks blue or green on the strip, modify this! It should be one of the values above

Example for Gemma M0:

import adafruit_dotstar
import time
from board import *

RED = 0x100000

with adafruit_dotstar.DotStar(APA102_SCK, APA102_MOSI, 1) as pixels:
    pixels[0] = RED
    time.sleep(2)
brightness

Overall brightness of the pixel

deinit()[source]

Blank out the DotStars and release the resources.

fill(color)[source]

Colors all pixels the given *color*.

show()[source]

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.