from machine import SPI, Pin
import time
time.sleep(0.1) # Wait for USB to become ready
matriz = SPI(0, 10000, sck=Pin(6), mosi= Pin(3), miso=Pin(4))
cs_matriz = Pin(5, Pin.OUT)
cs_matriz.value(1)
def Send(registro, valor):
cs_matriz.value(0)
matriz.write(bytearray([registro, valor]))
cs_matriz.value(1)
def Configure():
Send(0x09, 0)
Send(0x0A, 8)
Send(0x0B, 7)
Send(0x0C, 1)
def Paint(imagen):
for i in range(8):
Send(i+1, imagen[i])
creeper = [0xff,0xff,0x99,0x99,0xe7,0xc3,0xc3,0xdb]
#creeper = [0x3c,0x28,0x34,0x20,0x18,0x30,0x7c,0x6c]
Configure()
Paint(creeper)
while True:
pass