forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 3
Sample SPI MAX7219 8x8 LED Matrix
Takeo Takahashi edited this page Feb 17, 2022
·
3 revisions
-
MAX7219 8x8 LED Matrix displays character, alphabet and line.
-
Example of RA4M1 Clicker:
import time
import max7219
from machine import Pin, SPI
spi= SPI(1)
cs= Pin.cpu.P103
cs.init(cs.OUT, True)
display = max7219.Matrix8x8(spi, cs, 1)
# “1”を座標(0,0)でカラー1で描画
display.text("1",0,0,1)
display.show()
# 消去後、”A”を座標(0,0)にカラー1で描画
time.sleep(1)
display.fill(0)
display.show()
display.text("A",0,0,1)
display.show()
#消去後、縦線、横線をカラー1で描画
time.sleep(1)
display.fill(0)
display.hline(0,4,8,1)
display.vline(4,0,8,1)
display.show()
-
If
import max7219
causes an error, you need to upload the max7219.py module file to the target board. -
For EK-RA6M2, connect as followings:
MAX7219-PIN EK-RA6M2-PIN CLK P102 CS P103 DIN P101 GND GND VCC 3.3V -
For RA4M1 Clicker, connect as followings:
MAX7219-PIN RA4M1 Clicker-PIN CLK P102 CS P103 DIN P101 GND GND VCC 3.3V