# Bibliotheken laden
from machine import Pin
from neopixel import NeoPixel
from time import sleep_ms
# GPIO-Pin für WS2812
pin_np = 26
# Anzahl der LEDs
leds = 64
# Helligkeit: 0 bis 255
Rotwert = 120
Gruenwert = 120
Blauwert = 120
# Geschwindigkeit (Millisekunden)
speed = 50
# Initialisierung WS2812/NeoPixel
np = NeoPixel(Pin(pin_np, Pin.OUT), leds)
# Wiederholung (Endlos-Schleife)
while True:
for i in range (leds):
# Nächste LED einschalten
np[i] = (Rotwert, Gruenwert, Blauwert)
np.write()
sleep_ms(speed)
# LED zurücksetzen
np[i] = (0, 0, 0)