Created
October 9, 2020 07:21
-
-
Save dmpayton/1970439ce6be32c90a8484f22f72b1a4 to your computer and use it in GitHub Desktop.
Pan and NB flag colors on a Neopixel strip on a QTPy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import board | |
import time | |
import neopixel | |
from random import randint, choice | |
leds = neopixel.NeoPixel(board.RX, 50, pixel_order=neopixel.RGB) | |
palette = [ | |
# pan | |
0xff218c, | |
0xffd800, | |
0x21b1ff, | |
0x000000, | |
0x000000, | |
# nb | |
0xffd800, | |
0xfcfcfc, | |
0x6000ce, | |
0x020202, | |
0x000000, | |
0x000000, | |
] | |
c = 0 | |
while True: | |
leds[1:] = leds[0:] | |
leds[0] = palette[c] | |
time.sleep(0.1) | |
c += 1 | |
if c == len(palette): | |
c = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment