# Rmemeber to run : mpremote connect port:rfc2217://localhost:4000 run main.py
from machine import Pin
from neopixel import NeoPixel
from time import sleep
from random import randrange
led_max = 16
led_max2 = 16
led_max3 = 16
pixels = NeoPixel(Pin(21), led_max) # Pin 14; 16 LEDs
pixels2 = NeoPixel(Pin(5), led_max2) # Pin 14; 16 LEDs
pixels3 = NeoPixel(Pin(4), 16) # Pin 14; 16 LEDs
while True:
for i in range(16):
rot = randrange(0,256,10) # genearte randpnm numbers from 0 to 255 with 10 as step
gruen = randrange(0,256,16)
blau = randrange(0,256,16)
# Write those randonm numbers on the LEDs positions.
pixels[i]=[rot,gruen,blau]
pixels2[i]=[rot,gruen,blau]
pixels3[i]=[rot,gruen,blau]
pixels.write() # in die for-Anweisung einrücken
pixels2.write()
pixels3.write()
sleep(0.1) #