From a4aaae856ddc4a159af1ee2d1f9e7180187c25d3 Mon Sep 17 00:00:00 2001 From: lub Date: Mon, 1 Mar 2021 21:01:45 +0100 Subject: [PATCH] move sleep into set_all_leds --- src/blinki.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/blinki.py b/src/blinki.py index 4852589..cfc6462 100644 --- a/src/blinki.py +++ b/src/blinki.py @@ -7,7 +7,9 @@ def set_all_leds(device, grb=[0,0,0]): """ Takes a GRB color array as input and sets the color on all LEDs. """ - return device.set_led_data(0, grb*32) + return_value = device.set_led_data(0, grb*32) + sleep(0.02) # minimal delay to not crash the blinkstick + return return_value def morph_color(color, steps): """ Takes an int between 0-255 and either increments or decreases it by the specified steps. @@ -55,6 +57,5 @@ grb = [ while True: set_all_leds(device, grb) - sleep(0.02) # minimal delay to not crash the blinkstick grb = morph_grb(grb, 2)