本站改版新增arduino频道
# test of printing multiple fonts to the ILI9341 on an M5Stack using H/W SP
# MIT License; Copyright (c) 2017 Jeffrey N. Magee
from ili934xnew import ILI9341, color565
from machine import Pin, SPI
import m5stack
import tt14
import glcdfont
import tt14
import tt24
import tt32
fonts = [glcdfont,tt14,tt24,tt32]
text = 'Now is the time for all good men to come to the aid of the party.'
power = Pin(m5stack.TFT_LED_PIN, Pin.OUT)
power.value(0)
spi = SPI(
baudrate=80000000,
mosi=Pin(3),
sck=Pin(2),
miso=Pin(12)
)
display = ILI9341(
spi,
cs=Pin(7),
dc=Pin(6),
rst=Pin(10),
w=320,
h=240,
r=0)
display.erase()
display.set_pos(0,0)
display.set_font(tt24)
display.print("text text text text text")
display.set_pos(0,30)
display.set_font(tt24)
display.print("text text text text text")
"""
for ff in fonts:
display.set_font()
display.print(text)
"""源码下载地址:https://github.com/jeffmer/micropython-ili9341
Copyright © 2014 ESP56.com All Rights Reserved
晋ICP备14006235号-22 晋公网安备14108102001165号
执行时间: 0.0094459056854248 seconds