Skip to content

Instantly share code, notes, and snippets.

@dmpayton
Created October 9, 2020 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmpayton/1970439ce6be32c90a8484f22f72b1a4 to your computer and use it in GitHub Desktop.
Save dmpayton/1970439ce6be32c90a8484f22f72b1a4 to your computer and use it in GitHub Desktop.
Pan and NB flag colors on a Neopixel strip on a QTPy
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