Skip to content

Commit 12b023f

Browse files
authored
Merge pull request #1960 from adafruit/TheKitty-templates
Code for a board with one DotStar on board
2 parents cc4f50d + d4163ce commit 12b023f

File tree

1 file changed

+19
-0
lines changed
  • CircuitPython_Templates/status_led_one_dotstar_rgb

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2021 Anne Barela for Adafruit Industries
2+
# SPDX-License-Identifier: Unlicense
3+
"""
4+
CircuitPython DotStar red, green, blue, brightness control example - single DotStar.
5+
"""
6+
import time
7+
import board
8+
import adafruit_dotstar
9+
10+
dot = adafruit_dotstar.DotStar(board.DOTSTAR_CLOCK, board.DOTSTAR_DATA, 1)
11+
dot.brightness = 0.3
12+
13+
while True:
14+
dot.fill((255, 0, 0)) # Red
15+
time.sleep(0.5)
16+
dot.fill((0, 255, 0)) # Green
17+
time.sleep(0.5)
18+
dot.fill((0, 0, 255)) # Blue
19+
time.sleep(0.5)

0 commit comments

Comments
 (0)