Skip to content

Commit 9771907

Browse files
authored
Update picozero.py
On and fade times for RGB blink #23
1 parent 599f44b commit 9771907

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

picozero/picozero.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,14 +790,14 @@ def blink_generator():
790790
)
791791

792792
for c in range(len(colors)):
793+
if on_times[c] > 0:
794+
yield (colors[c], on_times[c])
795+
793796
if fade_times[c] > 0:
794797
for i in range(int(fps * fade_times[c])):
795798
v = lerp(i * (1 / fps) / fade_times[c], True, colors[(c + 1) % len(colors)], colors[c])
796799
t = 1 / fps
797800
yield (v, t)
798-
799-
if on_times[c] > 0:
800-
yield (colors[c], on_times[c])
801801

802802
self._start_change(blink_generator, n, wait)
803803

0 commit comments

Comments
 (0)