Add QT Py RP example.

This commit is contained in:
Kattni Rembor 2021-05-04 15:03:50 -04:00
parent c993b31a2f
commit d76cff9a09
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,22 @@
"""CircuitPython NeoPixel rainbow example for QT Py RP2040"""
import time
import board
import neopixel
from _pixelbuf import colorwheel
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, auto_write=False)
pixel.brightness = 0.3
def rainbow(delay):
for color_value in range(255):
for led in range(1):
pixel_index = (led * 256 // 1) + color_value
pixel[led] = colorwheel(pixel_index & 255)
pixel.show()
time.sleep(delay)
while True:
rainbow(0.02)