From 9754b84d207342ea9872aaa4a4a83902e4c8a100 Mon Sep 17 00:00:00 2001 From: Mathemmagician Date: Sun, 6 Mar 2022 16:48:23 -0500 Subject: [PATCH] Adding clear function and removing delay from fill --- neopixel.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neopixel.py b/neopixel.py index 029fd85..53c37d4 100644 --- a/neopixel.py +++ b/neopixel.py @@ -197,4 +197,7 @@ class Neopixel: def fill(self, rgb_w, how_bright = None): for i in range(self.num_leds): self.set_pixel(i, rgb_w, how_bright) - time.sleep(self.delay) + + # Clear the strip + def clear(self): + self.pixels = array.array("I", [0 for _ in range(self.num_leds)])