From 80e3ddb5682605e8e95cc6b4a579772cd94086e9 Mon Sep 17 00:00:00 2001 From: Ventilaar Date: Mon, 18 Jan 2021 14:04:13 +0100 Subject: [PATCH] refactored variables --- hardware.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/hardware.py b/hardware.py index 9e31151..54a99f5 100644 --- a/hardware.py +++ b/hardware.py @@ -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) ######################################