Skip to content

Commit

Permalink
clear pixels on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Dec 11, 2024
1 parent 5dd4b28 commit 4ec7bf8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions examples/led_animation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import time

import adafruit_pixelbuf
import board
from adafruit_led_animation.animation.rainbow import Rainbow
Expand Down Expand Up @@ -35,5 +37,10 @@ def _transmit(self, buf):
auto_clear=True,
)

while True:
animations.animate()
try:
while True:
animations.animate()
finally:
time.sleep(.02)
pixels.fill(0)
pixels.show()

0 comments on commit 4ec7bf8

Please sign in to comment.