From eeba48e52e77acab3b5c198b9c454fca5c4a09b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Mon, 16 May 2022 21:41:37 +0200 Subject: [PATCH] added power check to rainbow cycle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.py b/main.py index 4ebc81b..61e9128 100644 --- a/main.py +++ b/main.py @@ -43,6 +43,8 @@ def rainbowCycle(strip, wait_ms=5, iterations=10): for j in range(256*iterations): if mode > 0: break + elif power == "False": + break for i in range(strip.numPixels()): strip.setPixelColor(i, wheel((int(i * 256 / strip.numPixels()) + j) & 255)) strip.show()