Skip to content

Commit 969d48d

Browse files
committed
add docs
1 parent 397c723 commit 969d48d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

adafruit_led_animation/animation.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,17 +385,29 @@ def _auto_advance(self):
385385
self.next()
386386

387387
def next(self):
388+
"""
389+
Jump to the next animation.
390+
"""
388391
if self._auto_clear:
389392
self.fill(self.clear_color)
390393
self._current = (self._current + 1) % len(self._members)
391394

392395
def animate(self):
396+
"""
397+
Call animate() from your code's main loop. It will draw the current animation
398+
or go to the next animation based on the advance_interval if set.
399+
400+
:return: True if the animation draw cycle was triggered, otherwise False.
401+
"""
393402
if not self._paused:
394403
self._auto_advance()
395404
self.current_animation.animate()
396405

397406
@property
398407
def current_animation(self):
408+
"""
409+
Returns the current animation in the sequence.
410+
"""
399411
return self._members[self._current]
400412

401413
def change_color(self, color):
@@ -454,6 +466,12 @@ def __init__(self, *members, sync=False):
454466
main.peers = members[1:]
455467

456468
def animate(self):
469+
"""
470+
Call animate() from your code's main loop. It will draw all of the animations
471+
in the group.
472+
473+
:return: True if any animation draw cycle was triggered, otherwise False.
474+
"""
457475
if self._sync:
458476
return self._members[0].animate()
459477

0 commit comments

Comments
 (0)