fix(patterns): correct non-blocking timing and blink off phase
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -17,9 +17,10 @@ class Marquee:
|
||||
now = utime.ticks_ms()
|
||||
if utime.ticks_diff(now, last) >= d:
|
||||
c = self.driver.apply_brightness(colors[0], preset.b)
|
||||
bg_color = self.driver.apply_brightness(colors[-1], preset.b)
|
||||
for i in range(self.driver.num_leds):
|
||||
m = (i + phase) % (on_len + off_len)
|
||||
self.driver.n[i] = c if m < on_len else (0, 0, 0)
|
||||
self.driver.n[i] = c if m < on_len else bg_color
|
||||
self.driver.n.write()
|
||||
phase = (phase + step) % (on_len + off_len)
|
||||
self.driver.step = phase
|
||||
|
||||
Reference in New Issue
Block a user