Skip to content

Commit d4163ce

Browse files
authored
Code for a board with one DotStar onboard
For Template system - boards like ItsyBitsy M4 Express
1 parent cc4f50d commit d4163ce

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

  • CircuitPython_Templates/status_led_one_dotstar_rgb
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)