# Import MicroPython libraries of PIN and SPI
from machine import Pin, SPI

# Import MicoPython max7219 library
import max7219

# Import time
import time

#Intialize the SPI
spi = SPI(0, baudrate=10000000, polarity=1, phase=0, sck=Pin(2), mosi=Pin(3))
ss = Pin(5, Pin.OUT)

# Create matrix display instant, which has four MAX7219 devices.
display = max7219.Matrix8x8(spi, ss, 1)

#Set the display brightness. Value is 1 to 15.
display.brightness(1)

#Define the scrolling message
scrolling_message = "RASPBERRY PI PICO AND LED MATRIX"

#Get the message length
length = len(scrolling_message)

#Calculate number of columns of the message
column = (length * 8)

#Clear the display.
display.fill(0)
display.show()

#sleep for one one seconds
time.sleep(1)

# Unconditionally execute the loop
while True:
    for x in range(32, -column, -1):     
        #Clear the display
        display.fill(0)

        # Write the scrolling text in to frame buffer
        display.text(scrolling_message ,x,0,1)
        
        #Show the display
        display.show()
      
        #Set the Scrolling speed. Here it is 50mS.
        time.sleep(0.05)
 
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT
pico:GP0
pico:GP1
pico:GND.1
pico:GP2
pico:GP3
pico:GP4
pico:GP5
pico:GND.2
pico:GP6
pico:GP7
pico:GP8
pico:GP9
pico:GND.3
pico:GP10
pico:GP11
pico:GP12
pico:GP13
pico:GND.4
pico:GP14
pico:GP15
pico:GP16
pico:GP17
pico:GND.5
pico:GP18
pico:GP19
pico:GP20
pico:GP21
pico:GND.6
pico:GP22
pico:RUN
pico:GP26
pico:GP27
pico:GND.7
pico:GP28
pico:ADC_VREF
pico:3V3
pico:3V3_EN
pico:GND.8
pico:VSYS
pico:VBUS
matrix1:V+
matrix1:GND
matrix1:DIN
matrix1:CS
matrix1:CLK
matrix1:V+.2
matrix1:GND.2
matrix1:DOUT
matrix1:CS.2
matrix1:CLK.2