Skip to content

Commit 2165d38

Browse files
committed
Updated example for guide update
1 parent 242f7ab commit 2165d38

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

examples/dotstar_simpletest.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33
import board
44
import adafruit_dotstar as dotstar
55

6-
# One pixel connected internally on a GEMMA M0
7-
# pylint: disable=no-member
6+
# On-board DotStar for boards including Gemma, Trinket, and ItsyBitsy
87
dots = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
98

10-
# With a Dotstar Digital LEB Strip with 30 lights
11-
#dots = dotstar.DotStar(board.SCK, board.MOSI, 30, brightness=0.2)
9+
# Using a DotStar Digital LED Strip with 30 LEDs connected to hardware SPI
10+
# dots = dotstar.DotStar(board.SCK, board.MOSI, 30, brightness=0.2)
1211

13-
######################### HELPERS ##############################
12+
# Using a DotStar Digital LED Strip with 30 LEDs connected to digital pins
13+
# dots = dotstar.DotStar(board.D6, board.D5, 30, brightness=0.2)
1414

15+
16+
# HELPERS
1517
# a random color 0 -> 224
1618
def random_color():
1719
return random.randrange(0, 7) * 32
1820

19-
######################### MAIN LOOP ##############################
21+
22+
# MAIN LOOP
2023
n_dots = len(dots)
2124
while True:
22-
#fill each dot with a random color
25+
# Fill each dot with a random color
2326
for dot in range(n_dots):
2427
dots[dot] = (random_color(), random_color(), random_color())
2528

26-
# show all dots in strip
27-
dots.show()
28-
2929
time.sleep(.25)

0 commit comments

Comments
 (0)