Merge
This commit is contained in:
@@ -21,12 +21,28 @@ def send_sign(text):
|
|||||||
if len(lines) > ROWS:
|
if len(lines) > ROWS:
|
||||||
lines = lines[:ROWS]
|
lines = lines[:ROWS]
|
||||||
|
|
||||||
# The board controller expects spaces to be replaced with `0 for a blank character.
|
special_chars = {
|
||||||
board_lines = [line.replace(' ', '`0') for line in lines]
|
' ': '`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.
|
# setup_digits handles displaying the lines on the board.
|
||||||
# It will also vertically center the block of text.
|
# 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():
|
def poll_and_display():
|
||||||
|
|||||||
Reference in New Issue
Block a user