up
This commit is contained in:
parent
d9243b0928
commit
5b00bc7304
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user