1

refactored variables

This commit is contained in:
Ventilaar 2021-01-18 14:04:13 +01:00
parent 83838731d9
commit 80e3ddb568

View File

@ -32,8 +32,8 @@ strip.clear_strip()
# Function to light up an LED (je moet een hex waarde aanroepen in de vorm van bijv 0xFF0000)
def Strip(pixel, hex):
strip.set_pixel_rgb(pixel, hex)
def Strip(pixel, color_hex):
strip.set_pixel_rgb(pixel, color_hex)
strip.show()
@ -45,35 +45,35 @@ def resetstrip(delay):
# Function to fill the entire strip with 1 color
def fullstrip(hex):
Strip(0, hex)
Strip(1, hex)
Strip(2, hex)
Strip(3, hex)
Strip(4, hex)
Strip(5, hex)
Strip(6, hex)
Strip(7, hex)
return hex
def fullstrip(color_hex):
Strip(0, color_hex)
Strip(1, color_hex)
Strip(2, color_hex)
Strip(3, color_hex)
Strip(4, color_hex)
Strip(5, color_hex)
Strip(6, color_hex)
Strip(7, color_hex)
return color_hex
# Function to slowly fill strip from pixel 0 to 7 with a color (bc idk... fancy?)
def fillstrip(hex, delay):
Strip(0, hex)
def fillstrip(color_hex, delay):
Strip(0, color_hex)
time.sleep(delay)
Strip(1, hex)
Strip(1, color_hex)
time.sleep(delay)
Strip(2, hex)
Strip(2, color_hex)
time.sleep(delay)
Strip(3, hex)
Strip(3, color_hex)
time.sleep(delay)
Strip(4, hex)
Strip(4, color_hex)
time.sleep(delay)
Strip(5, hex)
Strip(5, color_hex)
time.sleep(delay)
Strip(6, hex)
Strip(6, color_hex)
time.sleep(delay)
Strip(7, hex)
Strip(7, color_hex)
######################################