This commit is contained in:
Tanner
2025-10-06 00:52:52 +01:00
parent 9718807fb7
commit 66398d4359

View File

@@ -21,12 +21,28 @@ def send_sign(text):
if len(lines) > ROWS:
lines = lines[:ROWS]
# The board controller expects spaces to be replaced with `0 for a blank character.
board_lines = [line.replace(' ', '`0') for line in lines]
special_chars = {
' ': '`0',
'\\w': '`1', # white
'\\r': '`2', # red
'\\o': '`3', # orange
'\\y': '`4', # yellow
'\\g': '`5', # green
'\\b': '`6', # blue
'\\v': '`7', # violet
'\\d': '`8', # degree
# '`9', # also degree
}
for code, color in special_chars.items():
lines = [line.replace(code, color) for line in lines]
# setup_digits handles displaying the lines on the board.
# It will also vertically center the block of text.
setup_digits(board_lines, left_to_right_swap=False, real_hw=True)
try:
setup_digits(lines, left_to_right_swap=False, real_hw=True)
except BaseException as e:
print "Error setting digits:" + str(e)
def poll_and_display():