code.py
1 # SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries 2 # 3 # SPDX-License-Identifier: MIT 4 5 import time 6 from rainbowio import colorwheel 7 import adafruit_dotstar 8 import board 9 10 # For Trinket M0, Gemma M0, and ItsyBitsy M0 Express 11 led = adafruit_dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1) 12 13 14 # For Feather M0 Express, Metro M0 Express, and Circuit Playground Express 15 # led = neopixel.NeoPixel(board.NEOPIXEL, 1) 16 17 led.brightness = 0.3 18 19 i = 0 20 while True: 21 i = (i + 1) % 256 # run from 0 to 255 22 led.fill(colorwheel(i)) 23 time.sleep(0.1)