Code for a board with one DotStar onboard
For Template system - boards like ItsyBitsy M4 Express
This commit is contained in:
parent
cc4f50d3a9
commit
d4163ceab1
1 changed files with 19 additions and 0 deletions
19
CircuitPython_Templates/status_led_one_dotstar_rgb/code.py
Normal file
19
CircuitPython_Templates/status_led_one_dotstar_rgb/code.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# SPDX-FileCopyrightText: 2021 Anne Barela for Adafruit Industries
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
"""
|
||||
CircuitPython DotStar red, green, blue, brightness control example - single DotStar.
|
||||
"""
|
||||
import time
|
||||
import board
|
||||
import adafruit_dotstar
|
||||
|
||||
dot = adafruit_dotstar.DotStar(board.DOTSTAR_CLOCK, board.DOTSTAR_DATA, 1)
|
||||
dot.brightness = 0.3
|
||||
|
||||
while True:
|
||||
dot.fill((255, 0, 0)) # Red
|
||||
time.sleep(0.5)
|
||||
dot.fill((0, 255, 0)) # Green
|
||||
time.sleep(0.5)
|
||||
dot.fill((0, 0, 255)) # Blue
|
||||
time.sleep(0.5)
|
||||
Loading…
Reference in a new issue