import max7219
from machine import Pin, SPI
from time import sleep
# Copied from this youtube video
# https://youtu.be/0oSXJf_RgPA
spi = SPI(0, baudrate=10_000_000, polarity=1, phase=0, sck=Pin(2), mosi=Pin(3))
ss = Pin(5, Pin.OUT)
msg = "Hello ECCE402 I'm sorry in advance"
length = len(msg) * 8
display = max7219.Matrix8x8(spi, ss, 4)
display.brightness(1)
display.fill(0)
display.show()
while True:
for x in range(32, -length, -1):
display.text(msg, x, 0, 1)
display.show()
sleep(0.1)
display.fill(0)