From d9064f0162692a46a16f30875f53a98bd799a0bd Mon Sep 17 00:00:00 2001 From: Hel Gibbons Date: Fri, 23 Jun 2023 15:23:41 +0100 Subject: [PATCH] SCD41: update Plasma Stick example --- micropython/examples/plasma_stick/co2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micropython/examples/plasma_stick/co2.py b/micropython/examples/plasma_stick/co2.py index 6dc1076b..f7ecd190 100644 --- a/micropython/examples/plasma_stick/co2.py +++ b/micropython/examples/plasma_stick/co2.py @@ -48,7 +48,7 @@ Temperature: {temperature:.2f} °C Humidity: {humidity:.2f} %""") # calculates a colour - hue = HUE_START + ((co2 - MIN) * (HUE_END - HUE_START) / (MAX - MIN)) + hue = max(0, HUE_START + ((co2 - MIN) * (HUE_END - HUE_START) / (MAX - MIN))) # set the leds for i in range(NUM_LEDS):