Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 8 additions & 6 deletions qwiic_alphanumeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,19 +965,21 @@ def print(self, print_string):
self.clear()

self.digit_position = 0
string_index = 0

for i in range(0, min(len(print_string), self.number_of_displays * 4)):
while string_index < len(print_string) and self.digit_position < (4 * self.number_of_displays):
# For special characters like '.' or ':', do not increment the digit position
if print_string[i] == '.':
if print_string[string_index] == '.':
self.print_char('.', 0)
elif print_string[i] == ':':
elif print_string[string_index] == ':':
self.print_char(':', 0)
else:
self.print_char(print_string[i], self.digit_position)
self.print_char(print_string[string_index], self.digit_position)
# Record to internal list
self.display_content[i] = print_string[i]
self.display_content[self.digit_position] = print_string[string_index]

self.digit_position = self.digit_position + 1
self.digit_position += 1
string_index += 1

self.update_display()

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# http://packaging.python.org/en/latest/tutorial.html#version
version='0.0.3',
version='0.0.4',

description='SparkFun Electronics qwiic alphanumeric package',
long_description=long_description,
Expand Down