fix(patterns): correct non-blocking timing and blink off phase
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,8 +15,9 @@ class Orbit:
|
||||
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
|
||||
for k in range(orbits):
|
||||
idx = ((phase * (k + 1)) // 8 + (k * self.driver.num_leds // max(1, orbits))) % max(1, self.driver.num_leds)
|
||||
self.driver.n[idx] = self.driver.apply_brightness(colors[k % len(colors)], preset.b)
|
||||
|
||||
Reference in New Issue
Block a user