code.py
1 # SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries 2 # SPDX-License-Identifier: MIT 3 """ 4 CircuitPython DotStar red, green, blue, brightness control example - multiple DotStars. 5 6 This example is meant for boards that have multiple built-in DotStar LEDs. 7 8 Update NUMBER_OF_PIXELS to the match the number of built-in DotStars on the board. 9 10 DO NOT INCLUDE THE pylint: disable LINE IN THE GUIDE CODE. It is present only to deal with the 11 NUMBER_OF_PIXELS variable being undefined in this pseudo-code. As you will be updating the variable 12 in the guide, you will not need the pylint: disable. 13 14 For example: 15 If you are using a FunHouse, change NUMBER_OF_PIXELS to 5. 16 """ 17 # pylint: disable=undefined-variable 18 19 import time 20 import board 21 import adafruit_dotstar 22 23 dots = adafruit_dotstar.DotStar(board.DOTSTAR_CLOCK, board.DOTSTAR_DATA, NUMBER_OF_PIXELS) 24 dots.brightness = 0.3 25 26 while True: 27 dots.fill((255, 0, 0)) 28 time.sleep(0.5) 29 dots.fill((0, 255, 0)) 30 time.sleep(0.5) 31 dots.fill((0, 0, 255)) 32 time.sleep(0.5)