From 5b00bc7304aa915edfa20963551a7a7e1aafd00f Mon Sep 17 00:00:00 2001 From: Tomas Krejci Date: Tue, 21 May 2024 17:50:34 +0200 Subject: [PATCH] up --- lib/rgb.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rgb.py b/lib/rgb.py index 913e7e1..117a19e 100644 --- a/lib/rgb.py +++ b/lib/rgb.py @@ -20,9 +20,9 @@ class RGB: async def set(self, r, g, b): global rgb_pwr - self.led_r.duty_u16(int(65535 * r * rgb_pwr)) - self.led_g.duty_u16(int(65535 * g * rgb_pwr)) - self.led_b.duty_u16(int(65535 * b * rgb_pwr)) + self.led_r.duty_u16(int(65535 * float(r) * rgb_pwr)) + self.led_g.duty_u16(int(65535 * float(g) * rgb_pwr)) + self.led_b.duty_u16(int(65535 * float(b) * rgb_pwr)) await uasyncio.sleep(0.01) async def on(self): @@ -78,7 +78,7 @@ class RGB: print("RGB demo") print("Press Ctrl-C to exit") await uasyncio.sleep(sec) - print("RGB power:", self.get_pwr()) + print(f"RGB power: {self.get_pwr()}") print("RGB initializing...") await uasyncio.sleep(sec)