Skip to content

Commit 3817cc6

Browse files
authored
Merge pull request #1536 from kattni/qtrp-code
Add QT Py RP example.
2 parents c993b31 + d76cff9 commit 3817cc6

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

File renamed without changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""CircuitPython NeoPixel rainbow example for QT Py RP2040"""
2+
import time
3+
import board
4+
import neopixel
5+
from _pixelbuf import colorwheel
6+
7+
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, auto_write=False)
8+
9+
pixel.brightness = 0.3
10+
11+
12+
def rainbow(delay):
13+
for color_value in range(255):
14+
for led in range(1):
15+
pixel_index = (led * 256 // 1) + color_value
16+
pixel[led] = colorwheel(pixel_index & 255)
17+
pixel.show()
18+
time.sleep(delay)
19+
20+
21+
while True:
22+
rainbow(0.02)

0 commit comments

Comments
 (0)