SSD1331 TFT-LCD显示屏的displayio驱动程序。
项目描述
介绍
SSD1331显示屏的displayio驱动程序
依赖项
此驱动程序依赖于
请确保所有依赖项都可在CircuitPython文件系统中使用。这可以通过下载Adafruit库和驱动程序捆绑包轻松实现。
使用示例
import board
import displayio
# Starting in CircuitPython 9.x fourwire will be a seperate internal library
# rather than a component of the displayio library
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire
import terminalio
from adafruit_display_text import label
from adafruit_ssd1331 import SSD1331
spi = board.SPI()
tft_cs = board.D5
tft_dc = board.D6
displayio.release_displays()
display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
display = SSD1331(display_bus, width=96, height=64)
# Make the display context
splash = displayio.Group()
display.root_group = splash
color_bitmap = displayio.Bitmap(96, 64, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0x00FF00 # Bright Green
bg_sprite = displayio.TileGrid(color_bitmap,
pixel_shader=color_palette,
x=0, y=0)
splash.append(bg_sprite)
# Draw a smaller inner rectangle
inner_bitmap = displayio.Bitmap(86, 54, 1)
inner_palette = displayio.Palette(1)
inner_palette[0] = 0xAA0088 # Purple
inner_sprite = displayio.TileGrid(inner_bitmap,
pixel_shader=inner_palette,
x=5, y=5)
splash.append(inner_sprite)
# Draw a label
text = "Hello World!"
text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00, x=12, y=32)
splash.append(text_area)
while True:
pass
文档
此库的API文档可在Read the Docs上找到。
有关构建库文档的信息,请参阅本指南。
贡献
欢迎贡献!请在贡献之前阅读我们的行为准则,以帮助本项目保持欢迎。
项目详情
关闭
哈希值 for adafruit_circuitpython_ssd1331-1.4.1-py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 41687eaf6fb9f05656b626f46862956acb7ebd03de397dcec9e725aaeb43046f |
|
MD5 | 9259bc36704c2ba00f3c236b245bd9b8 |
|
BLAKE2b-256 | d937c01146adb674aa032979c7b7cafdc3c2e6d3536fdc1f0db830e1dad37811 |