User Manual
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use
CircuitPython on Python 2.x, it isn't supported!
CircuitPython & Python Usage
To demonstrate the usage of the this library with DotStar LEDs, we'll use the board's Python REPL.
If you're using a SPI connection run the following code to import the necessary modules and initialize SPI with a strip of
30 DotStars:
Or if you're using bit banged pins, run the following code:
Now you're ready to light up your DotStar LEDs using the following properties:
brightness - The overall brightness of the LED
fill - Color all pixels a given color.
show - Update the LED colors if auto_write is set to False .
For example, to light up the first DotStar red:
To light up all the DotStars green:
import board
import adafruit_dotstar as dotstar
dots = dotstar.DotStar(board.SCK, board.MOSI, 30, brightness=0.2)
import board
import adafruit_dotstar as dotstar
dots = dotstar.DotStar(board.D6, board.D5, 30, brightness=0.2)
dots[0] = (255, 0, 0)
dots.fill((0, 255, 0))
© Adafruit Industries https://learn.adafruit.com/adafruit-dotstar-leds Page 46 of 48