import machine
import neopixel
import time
NUM_LEDS = 3
PIN_NUM = 4 # GP0
# Setup
pin = machine.Pin(PIN_NUM)
np = neopixel.NeoPixel(pin, NUM_LEDS)
# Farben setzen
def show_colors():
np[0] = (255, 0, 0) # Rot
np[1] = (0, 255, 0) # Grün
np[2] = (0, 0, 255) # Blau
np.write()
# Lauflicht
def chase(delay=0.2):
while True:
for i in range(NUM_LEDS):
np[i] = (255, 255, 255)
np.write()
time.sleep(delay)
np[i] = (0, 0, 0)
# Farben einmal anzeigen
show_colors()
time.sleep(2)
# Dann Lauflicht starten
chase()