diff --git a/examples/dotstar_simpletest.py b/examples/dotstar_simpletest.py index 309ea6b..f5da954 100644 --- a/examples/dotstar_simpletest.py +++ b/examples/dotstar_simpletest.py @@ -3,27 +3,27 @@ import board import adafruit_dotstar as dotstar -# One pixel connected internally on a GEMMA M0 -# pylint: disable=no-member +# On-board DotStar for boards including Gemma, Trinket, and ItsyBitsy dots = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2) -# With a Dotstar Digital LEB Strip with 30 lights -#dots = dotstar.DotStar(board.SCK, board.MOSI, 30, brightness=0.2) +# Using a DotStar Digital LED Strip with 30 LEDs connected to hardware SPI +# dots = dotstar.DotStar(board.SCK, board.MOSI, 30, brightness=0.2) -######################### HELPERS ############################## +# Using a DotStar Digital LED Strip with 30 LEDs connected to digital pins +# dots = dotstar.DotStar(board.D6, board.D5, 30, brightness=0.2) + +# HELPERS # a random color 0 -> 224 def random_color(): return random.randrange(0, 7) * 32 -######################### MAIN LOOP ############################## + +# MAIN LOOP n_dots = len(dots) while True: - #fill each dot with a random color + # Fill each dot with a random color for dot in range(n_dots): dots[dot] = (random_color(), random_color(), random_color()) - # show all dots in strip - dots.show() - time.sleep(.25)