Skip to content

Commit 795be50

Browse files
authored
Merge pull request #101 from arturo182/patch-1
sequence: Add a function to play the previous animation
2 parents 2e97f14 + 829cd1d commit 795be50

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

adafruit_led_animation/sequence.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,13 @@ def next(self):
179179
self.on_cycle_complete()
180180
self.activate(current % len(self._members))
181181

182+
def previous(self):
183+
"""
184+
Jump to the previous animation.
185+
"""
186+
current = self._current - 1
187+
self.activate(current % len(self._members))
188+
182189
def random(self):
183190
"""
184191
Jump to a random animation.

0 commit comments

Comments
 (0)