Skip to content

Commit 67ccb54

Browse files
authored
Merge pull request #57 from rhooper/sync-bugfix
fix sync when there are multiple different pixel objects involved
2 parents 22b9ec8 + cda2145 commit 67ccb54

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

adafruit_led_animation/group.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
__version__ = "0.0.0-auto.0"
4848
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation.git"
4949

50+
from adafruit_led_animation.animation import Animation
51+
5052

5153
class AnimationGroup:
5254
"""
@@ -158,7 +160,14 @@ def animate(self, show=True):
158160
if self._sync:
159161
result = self._members[0].animate(show=False)
160162
if result and show:
161-
self._members[0].show()
163+
last_strip = None
164+
for member in self._members:
165+
if isinstance(member, Animation):
166+
if last_strip != member.pixel_object:
167+
member.pixel_object.show()
168+
last_strip = member.pixel_object
169+
else:
170+
member.show()
162171
return result
163172

164173
return any([item.animate(show) for item in self._members])

0 commit comments

Comments
 (0)