Skip to content

Moved marquee functionality to HT16K33 library #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 15, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions adafruit_featherwing/led_segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,7 @@ def marquee(self, text, delay=0.25, loop=True):
:param bool loop: (optional) Whether to endlessly loop the text (default=True)

"""
if isinstance(text, str):
self.fill(False)
if loop:
while True:
self._scroll_marquee(text, delay)
else:
self._scroll_marquee(text, delay)

def _scroll_marquee(self, text, delay):
"""
Scroll through the text string once using the delay
"""
char_is_dot = False
for character in text:
self._segments.print(character)
# Add delay if character is not a dot or more than 2 in a row
if character != '.' or char_is_dot:
sleep(delay)
char_is_dot = (character == '.')
self._segments.show()
self._segments.marquee(text, delay, loop)

def fill(self, fill):
"""Change all Segments on or off
Expand Down