Add scripts

This commit is contained in:
2025-05-25 10:52:31 +02:00
commit 108cdfd88e
12 changed files with 734 additions and 0 deletions

34
03_pixel.py Normal file
View File

@ -0,0 +1,34 @@
import neopixel
from machine import Pin
import time
ws_pin = 0
led_zahl = 64
helligkeit = 0.05
matrix = neopixel.NeoPixel(Pin(ws_pin), led_zahl)
def setze_helligkeit(farbe):
r, g, b = farbe
r = int(r * helligkeit)
g = int(g * helligkeit)
b = int(b * helligkeit)
return (r, g, b)
def setze_pixel(i):
farbe = (255, 255, 255)
farbe = setze_helligkeit(farbe)
matrix[i] = farbe
x = 0
while True:
if x == 63:
x = 0
else:
x = x + 1
matrix.fill((0, 0, 0))
setze_pixel(x)
matrix.write()
time.sleep(0.05)