Code for a board with one DotStar onboard

For Template system - boards like ItsyBitsy M4 Express
This commit is contained in:
Anne Barela 2022-01-05 15:54:48 -05:00 committed by GitHub
parent cc4f50d3a9
commit d4163ceab1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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)