From da0ac1821f2be8388fc5421b695c9a19a6af7442 Mon Sep 17 00:00:00 2001 From: Ray Bellis Date: Tue, 2 Jan 2024 22:22:09 +0000 Subject: [PATCH] resolve precision error in python example too --- micropython/examples/plasma_stick/rainbows.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/micropython/examples/plasma_stick/rainbows.py b/micropython/examples/plasma_stick/rainbows.py index 5c0b5ea9..dc6d52bc 100644 --- a/micropython/examples/plasma_stick/rainbows.py +++ b/micropython/examples/plasma_stick/rainbows.py @@ -28,9 +28,10 @@ while True: SPEED = min(255, max(1, SPEED)) offset += float(SPEED) / 2000.0 + offset %= 1 for i in range(NUM_LEDS): - hue = float(i) / NUM_LEDS + hue = (offset + float(i) / NUM_LEDS) % 1 led_strip.set_hsv(i, hue + offset, 1.0, 1.0) time.sleep(1.0 / UPDATES)