Skip to content

Commit b3c5d13

Browse files
authored
Merge pull request #2130 from kattni/asyncio-blink-update
Simplify blink block.
2 parents 45aaacc + 83ec4c2 commit b3c5d13

File tree

1 file changed

+4
-1
lines changed
  • CircuitPython_Templates/asyncio

1 file changed

+4
-1
lines changed

CircuitPython_Templates/asyncio/code.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ async def rainbow_cycle(animation_controls):
5858
async def blink(animation_controls):
5959
"""Blink animation on ring two."""
6060
while True:
61-
ring_two[:] = [(0, 0, abs(ring_two[0][2] - 255))] * num_pixels
61+
ring_two.fill((0, 0, 255))
62+
ring_two.show()
6263
await asyncio.sleep(animation_controls.delay)
64+
ring_two.fill((0, 0, 0))
6365
ring_two.show()
66+
await asyncio.sleep(animation_controls.delay)
6467
await asyncio.sleep(animation_controls.wait)
6568

6669

0 commit comments

Comments
 (0)