display module

class display.Display(spi_port, cs_pin)[source]

Wrap the display Stores an internal character map

Parameters:
  • spi_port – SPI port to use
  • cs_pin – CS pin to use
characters = {' ': bytearray(b'\x00\x00\x00'), 'D': bytearray(b'\x00\x18\x18'), 'P': bytearray(b'<~z~f$'), 'H': bytearray(b'w\xe7\xc0\xc0\xe7w'), 'S': bytearray(b'\xe7w00w\xe7'), '1': bytearray(b'\x00|\x00'), '0': bytearray(b'|D|'), '3': bytearray(b'TT|'), '2': bytearray(b'tT\\'), '5': bytearray(b'\\Tt'), '4': bytearray(b'\x1c\x10|'), '7': bytearray(b'\x04\x04|'), '6': bytearray(b'|Tt'), '9': bytearray(b'\\T|'), '8': bytearray(b'|T|'), ':': bytearray(b'('), 'W': bytearray(b'\xc9\xd9\x19s\xe3\x07>\xfc')}
clear()[source]

Clear the display buffer N.B. Show need calling to actually update the display

show()[source]

Show the siaply buffer on the display

text(string, start=0)[source]

Write text to the display buffer N.B. Show need calling to actually update the display N.B. There is no bounds checking. Don’t write past the end of the display!

Parameters:
  • string – The string to write
  • start – Start column
display.inc_column(idx, column, by=1)[source]

Increment the index and column by the given amount

Parameters:
  • idx – The current LED matrix
  • column – The current column
  • by – How much to move
Returns:

Tuple of (idx, column)