fix(patterns): correct non-blocking timing and blink off phase
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
a79c6f4dd3
commit
fbebe9f4f9
19 files changed
+77
-28
No files matched your search
@@ -16,8 +16,9 @@ class RainDrops:
|
||||
d = max(1, int(preset.d))
|
||||
now = utime.ticks_ms()
|
||||
if utime.ticks_diff(now, last) >= d:
|
||||
bg_color = self.driver.apply_brightness(colors[-1], preset.b)
|
||||
for i in range(self.driver.num_leds):
|
||||
self.driver.n[i] = (0, 0, 0)
|
||||
self.driver.n[i] = bg_color
|
||||
if random.randint(0, 255) < rate:
|
||||
drops.append([random.randint(0, max(0, self.driver.num_leds - 1)), 0])
|
||||
nd = []
|
||||
|
||||
Reference in new issue
Block a user