import time
from machine import Pin
rows = [Pin(2, Pin.OUT), Pin(1, Pin.OUT), Pin(0, Pin.OUT)]
cols = [Pin(28, Pin.OUT), Pin(27, Pin.OUT), Pin(26, Pin.OUT)]
def setup():
for row in rows:
row.value(0)
for col in cols:
col.value(1)
setup()
while True:
for row in rows:
row.value(1)
for col in cols:
col.value(0)
time.sleep(0.5)
col.value(1)
row.value(0)