pilights/pylights.py

33 lines
640 B
Python
Raw Normal View History

2024-10-31 23:18:58 +00:00
import time
import board
import neopixel
pixel_pin=board.D18
num_pixels=30
brightness=1.0
auto_write=False
pixel_order=neopixel.RGB
pixels = neopixel.NeoPixel(
pixel_pin, num_pixels, brightness, auto_write, pixel_order
)
# Colours
darkorange=(253, 153, 13)
lightorange=(250, 205, 99)
black=(46, 46, 46)
lightpurple=(167, 142, 184)
darkpurple=(100, 75, 119)
halloween_cycle=[darkorange, lightorange, lightpurple, darkpurple, black]
def halloween(pos):
colour=0
while True:
if colour>4:
colour=0
pixels.fill(halloween_cycle[colour])
pixels.show()
time.sleep(1)
colour += 1