【发布时间】:2022-08-16 04:41:26
【问题描述】:
我一直在使用带有 esp8266 和 micropython 的单个 8×8 MAX7219 矩阵。我使用 mcauser 的库 (https://github.com/mcauser/micropython-max7219) 运行它。它可以正常工作。
而不是使用矩阵的内置字体,我想在矩阵上使用这样的字体:https://www.dafont.com/codi.font 或https://www.dafont.com/eight-bit-dragon.font
我见过人们这样做,但没有解释如何做。
这是我目前用于在此矩阵上滚动文本的代码:
import max7219
import time
from machine import Pin, SPI
spi = SPI(1, baudrate=10000000, polarity=0, phase=0)
display = max7219.Matrix8x8(spi, Pin(15), 1)
display.brightness(15)
display.fill(0)
display.show()
scroll_txt = \"Matrix Scroll\"
output = scroll_txt
# scroll text
p = 1 * 8
while True:
for p in range(1 * 8, len(output) * -8 - 1, -1):
display.fill(False)
display.text(output, p, 0, not False)
display.show()
time.sleep_ms(135)
谢谢, 马赫斯瓦尔
标签: fonts esp8266 micropython