import time
from machine import Pin
from neopixel import NeoPixel
time.sleep(0.1) # kurz warten auf die USB-Verbindung
#print("12-LED Neopixel-Ring mit Raspberry Pi Pico W")
# InformatikSchool4Girls 2026 Workshop OTH Amberg-Weiden
# http://www.oth-aw.de/schaefer-ulrich/pico/
ring = NeoPixel(Pin(27), 12) # Pin, 12 LEDs (bei diesem Ring)
def wheel(pos):
pos %= 256
if pos < 85:
return (255 - pos * 3, pos * 3, 0)
if pos < 170:
pos -= 85
return (0, 255 - pos * 3, pos * 3)
pos -= 170
return (pos * 3, 0, 255 - pos * 3)
for led in range(12):
color = wheel(led * 256 // 12)
ring[led] = color
ring.write()