chinese直男口爆体育生外卖, 99久久er热在这里只有精品99, 又色又爽又黄18禁美女裸身无遮挡, gogogo高清免费观看日本电视,私密按摩师高清版在线,人妻视频毛茸茸,91论坛 兴趣闲谈,欧美 亚洲 精品 8区,国产精品久久久久精品免费

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評(píng)論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會(huì)員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識(shí)你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

怎樣通過CircuitPython使用Adafruit eInk / ePaper顯示屏

454398 ? 來源:網(wǎng)絡(luò)整理 ? 作者:網(wǎng)絡(luò)整理 ? 2019-11-27 10:12 ? 次閱讀
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

概述

怎樣通過CircuitPython使用Adafruit eInk / ePaper顯示屏

本指南旨在幫助您通過CircuitPython快速使用Adafruit 2.13“三色電子墨水FeatherWing和2.7”三色電子墨水屏蔽。

這些顯示器已經(jīng)帶有標(biāo)題焊接-屏蔽型的公頭和羽毛型的母頭。這使它們無需焊接即可插入各自的微控制器。放在微控制器上,上傳代碼和圖形文件,然后顯示!

刷新時(shí)間

大多數(shù)LCD,OLEDLED顯示屏都可以很快地寫入,這有助于輕松地移動(dòng)圖形和顏色。

對(duì)于eInk顯示屏, 不是這種情況。擦除圖像涉及向顯示器發(fā)送特殊信號(hào),以“消除”彩色像素的顯示。 Adafruit建議不要每隔180秒(3分鐘)刷新一次這些顯示器。

如果將它們更快地寫入,則可能會(huì)損壞顯示器。損壞的顯示器可能會(huì)永久打開或關(guān)閉像素或出現(xiàn)其他異常情況,從而使保修無效。

電子墨水顯示器即使在關(guān)閉電源的情況下仍會(huì)繼續(xù)顯示圖像。如果您想要一個(gè)相當(dāng)靜態(tài)的圖像(例如圖片或名片),則eInk很棒。

如果您想要清晰,很少變化的顯示,則eInk很棒。有關(guān)快速變化的信息,請(qǐng)考慮使用其他類型的顯示器,例如TFT或OLED。

零件 羽毛形狀因數(shù)

Adafruit Feather M4 Express-配備ATSAMD51

產(chǎn)品編號(hào):3857

這就是您一直期待的配備ATSAMD51的Feather M4 Express。這羽羽毛像迅捷一樣迅捷,像貓頭鷹一樣聰明,像牛鳥一樣強(qiáng)壯(它是半牛,……

$ 22.95

庫存

添加到購物車

Adafruit 2.13英寸三色電子墨水/電子紙顯示屏FeatherWing

產(chǎn)品ID:4128

簡單的電子紙終于出現(xiàn)在您的Feather上,旨在輕松添加三色eInk顯示器的突破口,您可能已經(jīng)看到其中一種。..

$ 24.95

入庫存

添加到購物車

Metro Form Factor

/div》

Adafruit Metro M4特性Microchip ATSAMD51

產(chǎn)品ID:3382

您準(zhǔn)備好了嗎?真的準(zhǔn)備好了嗎?這是有史以來最快,功能最強(qiáng)大的Metro。AdafruitMetro M4具有Microchip ATSAMD51。這。..

$ 27.50

入庫價(jià)

添加到購物車

Adafruit帶有SRAM的2.7英寸三色eInk/ePaper防護(hù)罩

產(chǎn)品ID:4229

易于使用的電子紙終于出現(xiàn)在微控制器上,這一突破旨在使其輕而易舉地添加三色電子墨水顯示屏。您可能已經(jīng)看過其中之一。..

$ 39.95

入庫存

添加到購物車

編程

如果USB數(shù)據(jù)加電源線的一端適合您的計(jì)算機(jī),而另一端具有micro B連接器,則可以使用。下面的一個(gè)是最喜歡的,但可以根據(jù)需要選擇自己的一個(gè)。

粉紅色和紫色編織的USB A到Micro B電纜-2米長

產(chǎn)品ID:4148

該電纜非常流行,具有編織的粉紅色和紫色Blinka圖案。封面和包覆成型。我們將這些顏色制成自定義顏色,。..

$ 3.95

入庫存

添加到購物車

2.13英寸三色電子墨水羽翼

eInk FeatherWIng非常易于使用。它的背面有SD卡分線,母頭連接到Feather微控制器。

與羽毛微控制器的連接 《對(duì)于具有大量內(nèi)存的快速芯片,示例將其與Adafruit Feather M4 Express微控制器一起使用。目前,該板帶有未焊接的接頭。

2.7英寸三色電子墨水盾

此顯示器采用Arduino屏蔽形式,非常易于使用,背面具有SD卡分線,公頭可插入Metro尺寸微控制器。

與Metro微控制器的連接

對(duì)于具有大量內(nèi)存的快速芯片,本示例將此顯示器與Adafruit Metro M4 Express微控制器一起使用,屏蔽層應(yīng)插入帶有插頭的Metro M4中。如果您的Metro沒有母頭,請(qǐng)焊接它們。

CircuitPython和庫設(shè)置

編程

該CircuitPython指南中的所有快速入門示例均使用CircuitPython 5.0及更高版本中的新displayio驅(qū)動(dòng)程序。該代碼提供了強(qiáng)大的屏幕合成功能,并且已經(jīng)過優(yōu)化。雖然有使用舊版adafruit_epd方法的CircuitPython代碼示例,但將來會(huì)使用displayio。

在Feather上更新CircuitPython

您應(yīng)該檢查Feather上運(yùn)行的CircuitPython的版本。使用已知的優(yōu)質(zhì)數(shù)據(jù)+電源USB電纜將開發(fā)板插入計(jì)算機(jī)。該板應(yīng)該顯示為名為 CIRCUITPY 的計(jì)算機(jī)上的磁盤驅(qū)動(dòng)器。

打開 boot_out.txt 。這將向您顯示電路板已加載的CircuitPython的版本。

下載:文件

復(fù)制代碼

Adafruit CircuitPython 5.0.0-alpha.4 on 2019-09-15; Adafruit Feather M4 Express with samd51j19 Adafruit CircuitPython 5.0.0-alpha.4 on 2019-09-15; Adafruit Feather M4 Express with samd51j19

displayio需要CircuitPython 5或更高版本。如果您的電路板運(yùn)行的是CircuitPython的較低版本,則需要對(duì)其進(jìn)行更新。為您的電路板升級(jí)到最新版本的Adafruit CircuitPython。

必需的CircuitPython庫

要顯示帶有displayio的位圖,只有一個(gè)必需的庫,但這取決于您使用的顯示。

首先,確保為您的電路板運(yùn)行最新版本的Adafruit CircuitPython。

接下來,您需要安裝必要的庫才能使用硬件。仔細(xì)按照以下步驟從Adafruit的CircuitPython庫捆綁包中查找并安裝該庫。我們的簡介指南上有一個(gè)很棒的頁面,介紹如何為Express和非Express板安裝庫捆綁包。

由于捆綁包中的庫數(shù)量眾多,建議您從以下位置手動(dòng)安裝必要的庫捆綁包。第一個(gè)庫取決于您使用的eInk顯示器:

羽毛和2.13“三色eInk顯示器

adafruit_IL0373

Metro和2.7英寸三色電子墨水顯示屏

adafruit_il91874

接下來,獲得以下信息用于在displayio顯示器上顯示文本的庫。它用于第二個(gè)和第三個(gè)示例。

adafruit_display_text

在繼續(xù)之前,請(qǐng)確保您董事會(huì)的 lib 文件夾具有正確的驅(qū)動(dòng)程序文件和 adafruit_display_text 庫已復(fù)制。

示例:單個(gè)位圖

第一個(gè)示例讀取放置在電路板 CIRCUITPY 驅(qū)動(dòng)器上的位圖圖像,并將其顯示在eInk顯示屏上。

圖像

本示例中使用的圖像是CircuitPython文本圖像,顯示了各種元素。您可以通過單擊下面的綠色按鈕下載它。

display-ruler.bmp

用于制作自己的圖形,使其可以在三種顏色上顯示得體在這些顯示器上可用,請(qǐng)參閱指南為電子墨水顯示器準(zhǔn)備圖形。

如果圖片大于顯示器的寬度和高度,則其余部分將被截?cái)喽伙@示。建議您在使用圖像編輯器之前先縮放圖像,因?yàn)榇a不會(huì)縮放位圖。

將要使用的位圖縮放到圖像編輯器和抖動(dòng)中的顯示寬度和高度,否則僅使用黑色/白色/紅色。該代碼無法對(duì)位圖文件執(zhí)行圖像縮放。

代碼

下面的代碼將在主板的閃存驅(qū)動(dòng)器(在 CIRCUITPY 根目錄中)上放置一個(gè)位圖,并將其顯示在eInk顯示屏上。請(qǐng)參閱代碼中的注釋,以了解每個(gè)步驟如何有助于該過程。

請(qǐng)選擇特定于顯示器和微控制器的代碼,因?yàn)橐韵聝蓚€(gè)代碼塊對(duì)兩組硬件均不可互換。這些示例幾乎完全相同。

2.13“ eink FeatherWing示例

圖釘反映了FeatherWing eInk顯示器和Feather M4的組合。它還具有2.13英寸顯示器的像素尺寸。

下載:Zip 或 il91874_simpletest.py | 在Github上查看

復(fù)制代碼

“”“

Simple test script for 2.7” 264x176 Tri-Color display shield

Supported products:

* Adafruit 2.7“ Tri-Color ePaper Display Shield

https://www.adafruit.com/product/4229

This program only requires the adafruit_il91874 library in /lib

for CircuitPython 5.0 and above which has displayio support.

”“”

import time

import board

import displayio

import adafruit_il91874

# Used to ensure the display is free in CircuitPython

displayio.release_displays()

# Define the pins needed for display use on the Metro

spi = board.SPI()

epd_cs = board.D10

epd_dc = board.D9

# Create the displayio connection to the display pins

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,

baudrate=1000000)

time.sleep(1) # Wait a bit

# Create the display object - the third color is red (0xff0000)

display = adafruit_il91874.IL91874(display_bus, width=264, height=176,

highlight_color=0xff0000, rotation=90)

# Create a display group for our screen objects

g = displayio.Group()

# Display a ruler graphic from the root directory of the CIRCUITPY drive

f = open(“/display-ruler.bmp”, “rb”)

pic = displayio.OnDiskBitmap(f)

# Create a Tilegrid with the bitmap and put in the displayio group

t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())

g.append(t)

# Place the display group on the screen (does not refresh)

display.show(g)

# Show the image on the display

display.refresh()

print(“refreshed”)

# Do Not refresh the screen more often than every 180 seconds

# for eInk displays! Rapid refreshes will damage the panel.

time.sleep(180)

“”“

Simple test script for 2.7” 264x176 Tri-Color display shield

Supported products:

* Adafruit 2.7“ Tri-Color ePaper Display Shield

https://www.adafruit.com/product/4229

This program only requires the adafruit_il91874 library in /lib

for CircuitPython 5.0 and above which has displayio support.

”“”

import time

import board

import displayio

import adafruit_il91874

# Used to ensure the display is free in CircuitPython

displayio.release_displays()

# Define the pins needed for display use on the Metro

spi = board.SPI()

epd_cs = board.D10

epd_dc = board.D9

# Create the displayio connection to the display pins

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,

baudrate=1000000)

time.sleep(1) # Wait a bit

# Create the display object - the third color is red (0xff0000)

display = adafruit_il91874.IL91874(display_bus, width=264, height=176,

highlight_color=0xff0000, rotation=90)

# Create a display group for our screen objects

g = displayio.Group()

# Display a ruler graphic from the root directory of the CIRCUITPY drive

f = open(“/display-ruler.bmp”, “rb”)

pic = displayio.OnDiskBitmap(f)

# Create a Tilegrid with the bitmap and put in the displayio group

t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())

g.append(t)

# Place the display group on the screen (does not refresh)

display.show(g)

# Show the image on the display

display.refresh()

print(“refreshed”)

# Do Not refresh the screen more often than every 180 seconds

# for eInk displays! Rapid refreshes will damage the panel.

time.sleep(180)

2.7“ eInk Shield示例

這些引腳反映了屏蔽eInk顯示屏和Metro M4的組合。它還具有2.7英寸顯示屏的像素尺寸。

下載:Project Zip 或 il0373_2.13_color.py | 在Github上查看

復(fù)制代碼

“”“Simple test script for Adafruit 2.13” 212x104 tri-color display

Supported products:

* Adafruit 2.13“ Tri-Color Display Breakout

* https://www.adafruit.com/product/4086 (breakout) or

* https://www.adafruit.com/product/4128 (FeatherWing)

”“”

import time

import board

import displayio

import adafruit_il0373

# Used to ensure the display is free in CircuitPython

displayio.release_displays()

# Define the pins needed for display use

# This pinout is for a Feather M4 and may be different for other boards

spi = board.SPI() # Uses SCK and MOSI

epd_cs = board.D9

epd_dc = board.D10

epd_reset = board.D5

epd_busy = board.D6

# Create the displayio connection to the display pins

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,

reset=epd_reset, baudrate=1000000)

time.sleep(1) # Wait a bit

# Create the display object - the third color is red (0xff0000)

display = adafruit_il0373.IL0373(display_bus, width=212, height=104,

rotation=90, busy_pin=epd_busy,

highlight_color=0xff0000)

# Create a display group for our screen objects

g = displayio.Group()

# Display a ruler graphic from the root directory of the CIRCUITPY drive

f = open(“/display-ruler.bmp”, “rb”)

pic = displayio.OnDiskBitmap(f)

# Create a Tilegrid with the bitmap and put in the displayio group

t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())

g.append(t)

# Place the display group on the screen

display.show(g)

# Refresh the display to have it actually show the image

# NOTE: Do not refresh eInk displays sooner than 180 seconds

display.refresh()

print(“refreshed”)

time.sleep(180)

“”“Simple test script for Adafruit 2.13” 212x104 tri-color display

Supported products:

* Adafruit 2.13“ Tri-Color Display Breakout

* https://www.adafruit.com/product/4086 (breakout) or

* https://www.adafruit.com/product/4128 (FeatherWing)

”“”

import time

import board

import displayio

import adafruit_il0373

# Used to ensure the display is free in CircuitPython

displayio.release_displays()

# Define the pins needed for display use

# This pinout is for a Feather M4 and may be different for other boards

spi = board.SPI() # Uses SCK and MOSI

epd_cs = board.D9

epd_dc = board.D10

epd_reset = board.D5

epd_busy = board.D6

# Create the displayio connection to the display pins

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,

reset=epd_reset, baudrate=1000000)

time.sleep(1) # Wait a bit

# Create the display object - the third color is red (0xff0000)

display = adafruit_il0373.IL0373(display_bus, width=212, height=104,

rotation=90, busy_pin=epd_busy,

highlight_color=0xff0000)

# Create a display group for our screen objects

g = displayio.Group()

# Display a ruler graphic from the root directory of the CIRCUITPY drive

f = open(“/display-ruler.bmp”, “rb”)

pic = displayio.OnDiskBitmap(f)

# Create a Tilegrid with the bitmap and put in the displayio group

t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())

g.append(t)

# Place the display group on the screen

display.show(g)

# Refresh the display to have it actually show the image

# NOTE: Do not refresh eInk displays sooner than 180 seconds

display.refresh()

print(“refreshed”)

time.sleep(180)

代碼查看

有關(guān)使用對(duì)于使用CircuitPython進(jìn)行顯示,出色的指南CircuitPython顯示支持使用displayio是您的第一站。如果您想更深入地了解用于顯示器的模型,請(qǐng)參閱本指南。

Adafruit建議在嘗試執(zhí)行其他代碼以確保將顯示器連接至顯示器之前,使用 displayio函數(shù)。硬件是由CircuitPython發(fā)行的。

下一步是讓微控制器知道顯示器上使用了哪些引腳。所使用的銷釘非常依賴于顯示器,建議在尋求更換之前,先參考顯示器上的指南以了解已知的有效工作配置。 displayio.release_displays設(shè)置與顯示總線的displayio.FourWire連接。

通過總線,程序?qū)⒔⑴c顯示驅(qū)動(dòng)程序的連接。給出了顯示的大小(displayio和width),方向(height),忙碌引腳和突出顯示顏色。對(duì)于此三色顯示,指定了紅色(rotation)。

其余代碼遵循標(biāo)準(zhǔn)的0xff0000顯示設(shè)置和使用:

創(chuàng)建顯示組

打開要在顯示器上放置的位圖

創(chuàng)建位圖對(duì)象

創(chuàng)建一個(gè)TileGrid以使用位圖放置對(duì)象,并將圖塊組附加到顯示組

在屏幕上顯示顯示

刷新屏幕

最后,程序等待至少3分鐘。然后,程序?qū)⑼瓿刹⑥D(zhuǎn)到REPL。如果位圖應(yīng)保留在屏幕上,請(qǐng)?jiān)诔绦蚰┪蔡砑觗isplayio和while True:語句。

示例:簡單文本

此示例在eInk顯示屏上顯示文本,可以說是eInk的“ Hello World”。文本可以放在任何地方并縮放更大。

代碼

下面的代碼將使用內(nèi)部terminalio字體在eInk顯示屏上顯示一行文本。您可以設(shè)置前景色和背景色。請(qǐng)參閱注釋以了解每個(gè)步驟如何對(duì)過程作出貢獻(xiàn)。

請(qǐng)選擇特定于顯示器和微控制器的代碼,因?yàn)橐韵聝蓚€(gè)代碼塊對(duì)于兩組硬件均不可互換。這些示例幾乎完全相同。

2.13“ eink FeatherWing示例

圖釘反映了FeatherWing eInk顯示器和Feather M4的組合。它還具有2.13英寸顯示器的像素尺寸。

下載:Project Zip 或 213_tricolor_eink_fw_text.py | 在Github上查看

復(fù)制代碼

“”“

Simple text script for Adafruit 2.13” 212x104 tri-color display

Supported products:

* Adafruit 2.13“ Tri-Color Display Breakout

* Adafruit 2.13” Tri-Color Display FeatherWing

https://www.adafruit.com/product/4086 (breakout) or

https://www.adafruit.com/product/4128 (FeatherWing)

This program requires the adafruit_il0373 library and the

adafruit_display_text library in the CIRCUITPY /lib folder

for CircuitPython 5.0 and above which has displayio support.

“”“

import time

import board

import displayio

import adafruit_il0373

import terminalio

from adafruit_display_text import label

BLACK = 0x000000

WHITE = 0xFFFFFF

RED = 0xFF0000

# Change text colors, choose from the following values:

# BLACK, RED, WHITE

FOREGROUND_COLOR = RED

BACKGROUND_COLOR = WHITE

# Used to ensure the display is free in CircuitPython

displayio.release_displays()

# Define the pins needed for display use

# This pinout is for a Feather M4 and may be different for other boards

spi = board.SPI() # Uses SCK and MOSI

epd_cs = board.D9

epd_dc = board.D10

epd_reset = board.D5

epd_busy = board.D6

# Create the displayio connection to the display pins

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,

reset=epd_reset, baudrate=1000000)

time.sleep(1) # Wait a bit

# Create the display object - the third color is red (0xff0000)

DISPLAY_WIDTH = 212

DISPLAY_HEIGHT = 104

display = adafruit_il0373.IL0373(display_bus, width=DISPLAY_WIDTH,

height=DISPLAY_HEIGHT,

rotation=90, busy_pin=epd_busy,

highlight_color=0xff0000)

# Create a display group for our screen objects

g = displayio.Group(max_size=10)

# Set a background

background_bitmap = displayio.Bitmap(DISPLAY_WIDTH, DISPLAY_HEIGHT, 1)

# Map colors in a palette

palette = displayio.Palette(1)

palette[0] = BACKGROUND_COLOR

# Create a Tilegrid with the background and put in the displayio group

t = displayio.TileGrid(background_bitmap, pixel_shader=palette)

g.append(t)

# Draw simple text using the built-in font into a displayio group

text_group = displayio.Group(max_size=10, scale=2, x=20, y=40)

text = ”Hello World!“

text_area = label.Label(terminalio.FONT, text=text, color=FOREGROUND_COLOR)

text_group.append(text_area) # Add this text to the text group

g.append(text_group)

# Place the display group on the screen

display.show(g)

# Refresh the display to have everything show on the display

# NOTE: Do not refresh eInk displays more often than 180 seconds!

display.refresh()

time.sleep(120)

while True:

pass

”“”

Simple text script for Adafruit 2.13“ 212x104 tri-color display

Supported products:

* Adafruit 2.13” Tri-Color Display Breakout

* Adafruit 2.13“ Tri-Color Display FeatherWing

https://www.adafruit.com/product/4086 (breakout) or

https://www.adafruit.com/product/4128 (FeatherWing)

This program requires the adafruit_il0373 library and the

adafruit_display_text library in the CIRCUITPY /lib folder

for CircuitPython 5.0 and above which has displayio support.

”“”

import time

import board

import displayio

import adafruit_il0373

import terminalio

from adafruit_display_text import label

BLACK = 0x000000

WHITE = 0xFFFFFF

RED = 0xFF0000

# Change text colors, choose from the following values:

# BLACK, RED, WHITE

FOREGROUND_COLOR = RED

BACKGROUND_COLOR = WHITE

# Used to ensure the display is free in CircuitPython

displayio.release_displays()

# Define the pins needed for display use

# This pinout is for a Feather M4 and may be different for other boards

spi = board.SPI() # Uses SCK and MOSI

epd_cs = board.D9

epd_dc = board.D10

epd_reset = board.D5

epd_busy = board.D6

# Create the displayio connection to the display pins

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,

reset=epd_reset, baudrate=1000000)

time.sleep(1) # Wait a bit

# Create the display object - the third color is red (0xff0000)

DISPLAY_WIDTH = 212

DISPLAY_HEIGHT = 104

display = adafruit_il0373.IL0373(display_bus, width=DISPLAY_WIDTH,

height=DISPLAY_HEIGHT,

rotation=90, busy_pin=epd_busy,

highlight_color=0xff0000)

# Create a display group for our screen objects

g = displayio.Group(max_size=10)

# Set a background

background_bitmap = displayio.Bitmap(DISPLAY_WIDTH, DISPLAY_HEIGHT, 1)

# Map colors in a palette

palette = displayio.Palette(1)

palette[0] = BACKGROUND_COLOR

# Create a Tilegrid with the background and put in the displayio group

t = displayio.TileGrid(background_bitmap, pixel_shader=palette)

g.append(t)

# Draw simple text using the built-in font into a displayio group

text_group = displayio.Group(max_size=10, scale=2, x=20, y=40)

text = “Hello World!”

text_area = label.Label(terminalio.FONT, text=text, color=FOREGROUND_COLOR)

text_group.append(text_area) # Add this text to the text group

g.append(text_group)

# Place the display group on the screen

display.show(g)

# Refresh the display to have everything show on the display

# NOTE: Do not refresh eInk displays more often than 180 seconds!

display.refresh()

time.sleep(120)

while True:

pass

2.7“ eInk Shield示例

這些引腳反映了屏蔽eInk顯示屏和Metro M4的組合。它還具有2.7英寸顯示屏的像素尺寸。

下載:Project Zip 或 27_tricolor_eink_shiel d_text.py | 在Github上查看

復(fù)制代碼

“”“

Simple text script for 2.7” 264x176 Tri-Color display shield

Supported products:

* Adafruit 2.7“ Tri-Color ePaper Display Shield

https://www.adafruit.com/product/4229

This program requires the adafruit_il91874 and the

adafruit_display_text library in /lib on the CIRCUITPY drive

for CircuitPython 5.0 and above which has displayio support.

”“”

import time

import board

import displayio

import adafruit_il91874

import terminalio

from adafruit_display_text import label

BLACK = 0x000000

WHITE = 0xFFFFFF

RED = 0xFF0000

# Change text colors, choose from the following values:

# BLACK, WHITE, RED (note red on this display is not vivid)

FOREGROUND_COLOR = BLACK

BACKGROUND_COLOR = WHITE

# Used to ensure the display is free in CircuitPython

displayio.release_displays()

# Define the pins needed for display use on the Metro

spi = board.SPI()

epd_cs = board.D10

epd_dc = board.D9

# Create the displayio connection to the display pins

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,

baudrate=1000000)

time.sleep(1) # Wait a bit

# Create the display object - the third color is red (0xff0000)

DISPLAY_WIDTH = 264

DISPLAY_HEIGHT = 176

# Create the display object - the third color is red (0xff0000)

display = adafruit_il91874.IL91874(display_bus, width=DISPLAY_WIDTH,

height=DISPLAY_HEIGHT,

highlight_color=0xff0000, rotation=90)

# Create a display group for our screen objects

g = displayio.Group(max_size=10)

# Set a white background

background_bitmap = displayio.Bitmap(DISPLAY_WIDTH, DISPLAY_HEIGHT, 1)

# Map colors in a palette

palette = displayio.Palette(1)

palette[0] = BACKGROUND_COLOR

# Create a Tilegrid with the background and put in the displayio group

t = displayio.TileGrid(background_bitmap, pixel_shader=palette)

g.append(t)

# Draw simple text using the built-in font into a displayio group

text_group = displayio.Group(max_size=10, scale=2, x=40, y=40)

text = “Hello World!”

text_area = label.Label(terminalio.FONT, text=text, color=FOREGROUND_COLOR)

text_group.append(text_area) # Add this text to the text group

g.append(text_group)

# Place the display group on the screen

display.show(g)

# Refresh the display to have everything show on the display

# NOTE: Do not refresh eInk displays more often than 180 seconds!

display.refresh()

time.sleep(180)

while True:

pass

“”“

Simple text script for 2.7” 264x176 Tri-Color display shield

Supported products:

* Adafruit 2.7“ Tri-Color ePaper Display Shield

https://www.adafruit.com/product/4229

This program requires the adafruit_il91874 and the

adafruit_display_text library in /lib on the CIRCUITPY drive

for CircuitPython 5.0 and above which has displayio support.

”“”

import time

import board

import displayio

import adafruit_il91874

import terminalio

from adafruit_display_text import label

BLACK = 0x000000

WHITE = 0xFFFFFF

RED = 0xFF0000

# Change text colors, choose from the following values:

# BLACK, WHITE, RED (note red on this display is not vivid)

FOREGROUND_COLOR = BLACK

BACKGROUND_COLOR = WHITE

# Used to ensure the display is free in CircuitPython

displayio.release_displays()

# Define the pins needed for display use on the Metro

spi = board.SPI()

epd_cs = board.D10

epd_dc = board.D9

# Create the displayio connection to the display pins

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,

baudrate=1000000)

time.sleep(1) # Wait a bit

# Create the display object - the third color is red (0xff0000)

DISPLAY_WIDTH = 264

DISPLAY_HEIGHT = 176

# Create the display object - the third color is red (0xff0000)

display = adafruit_il91874.IL91874(display_bus, width=DISPLAY_WIDTH,

height=DISPLAY_HEIGHT,

highlight_color=0xff0000, rotation=90)

# Create a display group for our screen objects

g = displayio.Group(max_size=10)

# Set a white background

background_bitmap = displayio.Bitmap(DISPLAY_WIDTH, DISPLAY_HEIGHT, 1)

# Map colors in a palette

palette = displayio.Palette(1)

palette[0] = BACKGROUND_COLOR

# Create a Tilegrid with the background and put in the displayio group

t = displayio.TileGrid(background_bitmap, pixel_shader=palette)

g.append(t)

# Draw simple text using the built-in font into a displayio group

text_group = displayio.Group(max_size=10, scale=2, x=40, y=40)

text = “Hello World!”

text_area = label.Label(terminalio.FONT, text=text, color=FOREGROUND_COLOR)

text_group.append(text_area) # Add this text to the text group

g.append(text_group)

# Place the display group on the screen

display.show(g)

# Refresh the display to have everything show on the display

# NOTE: Do not refresh eInk displays more often than 180 seconds!

display.refresh()

time.sleep(180)

while True:

pass

代碼查看

對(duì)于概述將displayio用于CircuitPython的顯示,這是出色的指南,使用displayio的CircuitPython顯示支持是您的第一站。如果您想更深入地了解用于顯示器的模型,請(qǐng)參閱本指南。

Adafruit建議在嘗試執(zhí)行其他代碼以確保顯示器連接到顯示器之前,使用 displayio.release_displays()函數(shù)。

下一步是讓displayio知道顯示器上使用了哪些引腳。所使用的特定引腳在很大程度上取決于顯示器,建議您在尋求更改之前,先參考顯示器上的指南以了解已知的工作配置。 displayio.FourWire設(shè)置與顯示總線的displayio連接。

使用總線,程序建立與顯示驅(qū)動(dòng)器。給出了顯示的大?。╝dafruit_il0373和width),方向(height),忙碌引腳和突出顯示顏色。對(duì)于此三色顯示,指定了紅色(rotation)。

其余代碼遵循標(biāo)準(zhǔn)的0xff0000顯示設(shè)置和使用:

創(chuàng)建顯示組

將所需的背景色設(shè)置為位圖

創(chuàng)建TileGrid以將對(duì)象與位圖一起放入并將圖塊組附加到顯示組中

為文本添加顯示組項(xiàng)目并使用“ Hello World!”作為示例文本。文本將按比例縮放兩個(gè)大小,并位于displayio,x=40處,以將其從左上方向下移動(dòng)到右側(cè)。

在屏幕上顯示顯示內(nèi)容

刷新屏幕

最后,程序等待3分鐘(最小刷新時(shí)間。然后,程序使用y=40和while True:語句來保持當(dāng)前狀態(tài)直到處理器復(fù)位為止。

示例:姓名徽章

最后一個(gè)示例在eInk顯示器上的位圖上顯示文本,從而使名稱徽章對(duì)于聚會(huì)或會(huì)議非常有用。

圖像

此示例使用BMP格式的方形圖片文件顯示在顯示屏的左側(cè)??赡苁悄橙说膱D片,徽標(biāo)或其他藝術(shù)品。

要使用高度為104像素的2.13“顯示器,請(qǐng)將圖像設(shè)為104x104。

要使用2.7”顯示屏的高度為176像素,使圖像的尺寸為176x176。

由于eInk顯示屏只能使用3種顏色,因此請(qǐng)參閱隨附的指南“為E-Ink顯示屏準(zhǔn)備圖形”。查看它們可能如何在您選擇的顯示器上最佳顯示。

以下是示例中使用的示例圖片。對(duì)于2.13英寸顯示屏,請(qǐng)使用較小的圖片;對(duì)于2.7英寸屏蔽板,請(qǐng)使用較大的圖片。將圖像作為 picture.bmp 復(fù)制到開發(fā)板的 CIRCUITPY 驅(qū)動(dòng)器。

代碼

下面的代碼將在左側(cè)顯示一個(gè)正方形圖片,使用internal terminalio字體在eInk顯示屏的右側(cè)放置兩行文本。您可以設(shè)置前景色和背景色。請(qǐng)參閱注釋以了解每個(gè)步驟如何對(duì)過程作出貢獻(xiàn)。

請(qǐng)選擇特定于顯示器和微控制器的代碼,因?yàn)橐韵聝蓚€(gè)代碼塊對(duì)于兩組硬件均不可互換。這些示例幾乎是相同的。

“ 2.13”顯示效果更真實(shí)紅色,而2.7英寸顯示屏則使用更多的粉紅色。這完全取決于顯示器的制造方式,而不取決于顯示器本身的顏色問題。請(qǐng)將此因素納入您的顏色選擇計(jì)劃中。

2.13“ eInk FeatherWing示例

引腳反映了FeatherWing eInk顯示器和Feather M4的組合。它還具有2.13英寸顯示器的像素尺寸。

下載:Project Zip 或 213_tricolor_eink_fw_badge.py | 在Github上查看

復(fù)制代碼

“”“

Simple badge script for Adafruit 2.13” 212x104 tri-color display

Supported products:

* Adafruit 2.13“ Tri-Color Display Breakout

* https://www.adafruit.com/product/4086 (breakout) or

* https://www.adafruit.com/product/4128 (FeatherWing)

This program requires the adafruit_il0373 library and the

adafruit_display_text library in the CIRCUITPY /lib folder

for CircuitPython 5.0 and above which has displayio support.

”“”

import time

import board

import displayio

import adafruit_il0373

import terminalio

from adafruit_display_text import label

BLACK = 0x000000

WHITE = 0xFFFFFF

RED = 0xFF0000

# Change text colors, choose from the following values:

# BLACK, RED, WHITE

TEXT_COLOR = BLACK

BACKGROUND_COLOR = WHITE

# Used to ensure the display is free in CircuitPython

displayio.release_displays()

# Define the pins needed for display use

# This pinout is for a Feather M4 and may be different for other boards

spi = board.SPI() # Uses SCK and MOSI

epd_cs = board.D9

epd_dc = board.D10

epd_reset = board.D5

epd_busy = board.D6

# Create the displayio connection to the display pins

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,

reset=epd_reset, baudrate=1000000)

time.sleep(1) # Wait a bit

DISPLAY_WIDTH = 212

DISPLAY_HEIGHT = 104

# Create the display object - the third color is red (0xff0000)

display = adafruit_il0373.IL0373(display_bus, width=DISPLAY_WIDTH,

height=DISPLAY_HEIGHT,

rotation=90, busy_pin=epd_busy,

highlight_color=0xff0000)

# Create a display group for our screen objects

g = displayio.Group()

# Set a background

background_bitmap = displayio.Bitmap(DISPLAY_WIDTH, DISPLAY_HEIGHT, 1)

# Map colors in a palette

palette = displayio.Palette(1)

palette[0] = BACKGROUND_COLOR

# Put the background into the display group

bg_sprite = displayio.TileGrid(background_bitmap,

pixel_shader=palette,

x=0, y=0)

g.append(bg_sprite)

# Display a picture from the root directory of the CIRCUITPY drive

# Picture should be HEIGHTxHEIGHT square idealy for a portrait

# But could be the entire WIDTHxHEIGHT for a non-portrait

f = open(“/picture.bmp”, “rb”)

pic = displayio.OnDiskBitmap(f)

# Create a Tilegrid with the bitmap and put in the displayio group

t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())

g.append(t)

# Draw simple text using the built-in font into a displayio group

# For smaller text, change scale=2 to scale=1

text_group = displayio.Group(max_size=10, scale=2,

x=DISPLAY_HEIGHT + 10,

y=int(DISPLAY_HEIGHT/2) - 13)

first_name = “Limor”

text_area = label.Label(terminalio.FONT, text=first_name,

color=TEXT_COLOR)

text_group.append(text_area) # Add this text to the text group

g.append(text_group)

# Draw simple text using the built-in font into a displayio group

text_group = displayio.Group(max_size=10, scale=2,

x=DISPLAY_HEIGHT + 10,

y=int(DISPLAY_HEIGHT/2) + 13)

last_name = “Ladyada”

text_area = label.Label(terminalio.FONT, text=last_name,

color=TEXT_COLOR)

text_group.append(text_area) # Add this text to the text group

g.append(text_group)

# Place the display group on the screen

display.show(g)

# Refresh the display to have it actually show

# NOTE: Do not refresh eInk displays more often than 180 seconds!

display.refresh()

# Wait the minimum 3 minutes between refreshes. Then loop to freeze.

time.sleep(180)

while True:

pass

“”“

Simple badge script for Adafruit 2.13” 212x104 tri-color display

Supported products:

* Adafruit 2.13“ Tri-Color Display Breakout

* https://www.adafruit.com/product/4086 (breakout) or

* https://www.adafruit.com/product/4128 (FeatherWing)

This program requires the adafruit_il0373 library and the

adafruit_display_text library in the CIRCUITPY /lib folder

for CircuitPython 5.0 and above which has displayio support.

”“”

import time

import board

import displayio

import adafruit_il0373

import terminalio

from adafruit_display_text import label

BLACK = 0x000000

WHITE = 0xFFFFFF

RED = 0xFF0000

# Change text colors, choose from the following values:

# BLACK, RED, WHITE

TEXT_COLOR = BLACK

BACKGROUND_COLOR = WHITE

# Used to ensure the display is free in CircuitPython

displayio.release_displays()

# Define the pins needed for display use

# This pinout is for a Feather M4 and may be different for other boards

spi = board.SPI() # Uses SCK and MOSI

epd_cs = board.D9

epd_dc = board.D10

epd_reset = board.D5

epd_busy = board.D6

# Create the displayio connection to the display pins

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,

reset=epd_reset, baudrate=1000000)

time.sleep(1) # Wait a bit

DISPLAY_WIDTH = 212

DISPLAY_HEIGHT = 104

# Create the display object - the third color is red (0xff0000)

display = adafruit_il0373.IL0373(display_bus, width=DISPLAY_WIDTH,

height=DISPLAY_HEIGHT,

rotation=90, busy_pin=epd_busy,

highlight_color=0xff0000)

# Create a display group for our screen objects

g = displayio.Group()

# Set a background

background_bitmap = displayio.Bitmap(DISPLAY_WIDTH, DISPLAY_HEIGHT, 1)

# Map colors in a palette

palette = displayio.Palette(1)

palette[0] = BACKGROUND_COLOR

# Put the background into the display group

bg_sprite = displayio.TileGrid(background_bitmap,

pixel_shader=palette,

x=0, y=0)

g.append(bg_sprite)

# Display a picture from the root directory of the CIRCUITPY drive

# Picture should be HEIGHTxHEIGHT square idealy for a portrait

# But could be the entire WIDTHxHEIGHT for a non-portrait

f = open(“/picture.bmp”, “rb”)

pic = displayio.OnDiskBitmap(f)

# Create a Tilegrid with the bitmap and put in the displayio group

t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())

g.append(t)

# Draw simple text using the built-in font into a displayio group

# For smaller text, change scale=2 to scale=1

text_group = displayio.Group(max_size=10, scale=2,

x=DISPLAY_HEIGHT + 10,

y=int(DISPLAY_HEIGHT/2) - 13)

first_name = “Limor”

text_area = label.Label(terminalio.FONT, text=first_name,

color=TEXT_COLOR)

text_group.append(text_area) # Add this text to the text group

g.append(text_group)

# Draw simple text using the built-in font into a displayio group

text_group = displayio.Group(max_size=10, scale=2,

x=DISPLAY_HEIGHT + 10,

y=int(DISPLAY_HEIGHT/2) + 13)

last_name = “Ladyada”

text_area = label.Label(terminalio.FONT, text=last_name,

color=TEXT_COLOR)

text_group.append(text_area) # Add this text to the text group

g.append(text_group)

# Place the display group on the screen

display.show(g)

# Refresh the display to have it actually show

# NOTE: Do not refresh eInk displays more often than 180 seconds!

display.refresh()

# Wait the minimum 3 minutes between refreshes. Then loop to freeze.

time.sleep(180)

while True:

pass

div》 2.7“ eInk Shield示例

引腳反映了屏蔽eInk顯示屏和Metro M4的組合。它具有2.7”顯示屏的像素尺寸。

下載:Project Zip 或 27 _tricolor_eink_shield_badge.py | 在Github上查看

復(fù)制代碼

“”“

Simple Badge script for a 2.7” 264x176 Tri-Color eInk display shield

Supported products:

* Adafruit 2.7“ Tri-Color ePaper Display Shield

https://www.adafruit.com/product/4229

This program requires the adafruit_il91874 and the

adafruit_display_text library in /lib on the CIRCUITPY drive

for CircuitPython 5.0 and above which has displayio support.

”“”

import time

import board

import displayio

import adafruit_il91874

import terminalio

from adafruit_display_text import label

BLACK = 0x000000

WHITE = 0xFFFFFF

RED = 0xFF0000

# Change text colors, choose from the following values:

# BLACK, RED, WHITE

TEXT_COLOR = BLACK

BACKGROUND_COLOR = WHITE

# Used to ensure the display is free in CircuitPython

displayio.release_displays()

# Define the pins needed for display use on the Metro

spi = board.SPI()

epd_cs = board.D10

epd_dc = board.D9

# Create the displayio connection to the display pins

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,

baudrate=1000000)

time.sleep(1) # Wait a bit

DISPLAY_WIDTH = 264

DISPLAY_HEIGHT = 176

# Create the display object - the third color is red (0xff0000)

display = adafruit_il91874.IL91874(display_bus, width=DISPLAY_WIDTH,

height=DISPLAY_HEIGHT,

highlight_color=0xff0000, rotation=90)

# Create a display group for our screen objects

g = displayio.Group(max_size=10)

# Set a background

background_bitmap = displayio.Bitmap(DISPLAY_WIDTH, DISPLAY_HEIGHT, 1)

# Map colors in a palette

palette = displayio.Palette(1)

palette[0] = BACKGROUND_COLOR

# Put the background into the display group

bg_sprite = displayio.TileGrid(background_bitmap,

pixel_shader=palette,

x=0, y=0)

g.append(bg_sprite)

# Display a picture from the root directory of the CIRCUITPY drive

# Picture should be HEIGHTxHEIGHT square idealy for a portrait

# But could be the entire WIDTHxHEIGHT for a non-portrait

f = open(“/picture.bmp”, “rb”)

pic = displayio.OnDiskBitmap(f)

# Create a Tilegrid with the bitmap and put in the displayio group

t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())

g.append(t)

# Draw simple text using the built-in font into a displayio group

# For smaller text, change scale=2 to scale=1 as scale 2 doesn‘t

# allow for much text but the text is bigger.

text_group = displayio.Group(max_size=10, scale=2,

x=DISPLAY_HEIGHT + 5,

y=int(DISPLAY_HEIGHT/2) - 13)

first_name = “Limor”

text_area = label.Label(terminalio.FONT, text=first_name,

color=TEXT_COLOR)

text_group.append(text_area) # Add this text to the text group

g.append(text_group)

# Draw simple text using the built-in font into a displayio group

# For smaller text, change scale=2 to scale=1 as scale 2 doesn’t

# allow for much text but the text is bigger.

text_group = displayio.Group(max_size=10, scale=2,

x=DISPLAY_HEIGHT + 5,

y=int(DISPLAY_HEIGHT/2) + 13)

last_name = “Fried”

text_area = label.Label(terminalio.FONT, text=last_name,

color=TEXT_COLOR)

text_group.append(text_area) # Add this text to the text group

g.append(text_group)

# Place the display group on the screen

display.show(g)

# Refresh the display to have it actually show

# NOTE: Do not refresh eInk displays more often than 180 seconds!

display.refresh()

# Wait the minimum 3 minutes between refreshes. Then loop to freeze.

time.sleep(180)

while True:

pass

“”“

Simple Badge script for a 2.7” 264x176 Tri-Color eInk display shield

Supported products:

* Adafruit 2.7“ Tri-Color ePaper Display Shield

https://www.adafruit.com/product/4229

This program requires the adafruit_il91874 and the

adafruit_display_text library in /lib on the CIRCUITPY drive

for CircuitPython 5.0 and above which has displayio support.

”“”

import time

import board

import displayio

import adafruit_il91874

import terminalio

from adafruit_display_text import label

BLACK = 0x000000

WHITE = 0xFFFFFF

RED = 0xFF0000

# Change text colors, choose from the following values:

# BLACK, RED, WHITE

TEXT_COLOR = BLACK

BACKGROUND_COLOR = WHITE

# Used to ensure the display is free in CircuitPython

displayio.release_displays()

# Define the pins needed for display use on the Metro

spi = board.SPI()

epd_cs = board.D10

epd_dc = board.D9

# Create the displayio connection to the display pins

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs,

baudrate=1000000)

time.sleep(1) # Wait a bit

DISPLAY_WIDTH = 264

DISPLAY_HEIGHT = 176

# Create the display object - the third color is red (0xff0000)

display = adafruit_il91874.IL91874(display_bus, width=DISPLAY_WIDTH,

height=DISPLAY_HEIGHT,

highlight_color=0xff0000, rotation=90)

# Create a display group for our screen objects

g = displayio.Group(max_size=10)

# Set a background

background_bitmap = displayio.Bitmap(DISPLAY_WIDTH, DISPLAY_HEIGHT, 1)

# Map colors in a palette

palette = displayio.Palette(1)

palette[0] = BACKGROUND_COLOR

# Put the background into the display group

bg_sprite = displayio.TileGrid(background_bitmap,

pixel_shader=palette,

x=0, y=0)

g.append(bg_sprite)

# Display a picture from the root directory of the CIRCUITPY drive

# Picture should be HEIGHTxHEIGHT square idealy for a portrait

# But could be the entire WIDTHxHEIGHT for a non-portrait

f = open(“/picture.bmp”, “rb”)

pic = displayio.OnDiskBitmap(f)

# Create a Tilegrid with the bitmap and put in the displayio group

t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())

g.append(t)

# Draw simple text using the built-in font into a displayio group

# For smaller text, change scale=2 to scale=1 as scale 2 doesn‘t

# allow for much text but the text is bigger.

text_group = displayio.Group(max_size=10, scale=2,

x=DISPLAY_HEIGHT + 5,

y=int(DISPLAY_HEIGHT/2) - 13)

first_name = “Limor”

text_area = label.Label(terminalio.FONT, text=first_name,

color=TEXT_COLOR)

text_group.append(text_area) # Add this text to the text group

g.append(text_group)

# Draw simple text using the built-in font into a displayio group

# For smaller text, change scale=2 to scale=1 as scale 2 doesn’t

# allow for much text but the text is bigger.

text_group = displayio.Group(max_size=10, scale=2,

x=DISPLAY_HEIGHT + 5,

y=int(DISPLAY_HEIGHT/2) + 13)

last_name = “Fried”

text_area = label.Label(terminalio.FONT, text=last_name,

color=TEXT_COLOR)

text_group.append(text_area) # Add this text to the text group

g.append(text_group)

# Place the display group on the screen

display.show(g)

# Refresh the display to have it actually show

# NOTE: Do not refresh eInk displays more often than 180 seconds!

display.refresh()

# Wait the minimum 3 minutes between refreshes. Then loop to freeze.

time.sleep(180)

while True:

pass

代碼查看

對(duì)于概述將displayio用于CircuitPython的顯示,這是出色的指南,使用displayio的CircuitPython顯示支持是您的第一站。如果您想更深入地了解用于顯示器的模型,請(qǐng)參閱本指南。

Adafruit建議在嘗試執(zhí)行其他代碼以確保顯示器連接到顯示器之前,使用 displayio.release_displays()函數(shù)。

下一步是讓displayio知道顯示器上使用了哪些引腳。所使用的特定引腳在很大程度上取決于顯示器,建議您在尋求更改之前,先參考顯示器上的指南以了解已知的工作配置。 displayio.FourWire設(shè)置與顯示總線的displayio連接。

定義了顯示尺寸(特定于顯示器)。然后在總線上,程序建立與顯示驅(qū)動(dòng)程序的連接。給出了顯示的大?。╳idth和height),方向(rotation),忙碌引腳和突出顯示顏色。對(duì)于此三色顯示,指定了紅色(0xff0000)。

其余代碼與后兩個(gè)示例非常相似。首先,從 CIRCUITPY 驅(qū)動(dòng)器的根目錄中讀取一個(gè)名為 picture.bmp 的位圖圖形。通過displayio.TileGrid在顯示組中設(shè)置圖形。然后定義兩行文本。它們被放置在位圖的右邊幾個(gè)像素處,并與顯示高度的中間等距。

此莊園中容納的文字很少。您可以通過兩種方法來獲得更大的文本寬度:

將scale=2更改為scale=1將使每行字符更多,但文本將更小。

如果需要最終的靈活性,建議您將所有設(shè)計(jì)元素創(chuàng)建到一個(gè)位圖圖片中,并使用第一個(gè)示例僅顯示位圖。

該程序?qū)⑺薪M放置屏幕上具有display.show的元素將刷新display.refresh的顯示,以實(shí)際顯示圖形。 eInk顯示器需要2-3秒鐘才能刪除上一張圖像并顯示新圖像。

最后,程序?qū)⒌却?分鐘。 while True:和pass 循環(huán)位于程序的末尾,因此REPL不會(huì)擦除標(biāo)志圖像。按下重置按鈕將再次啟動(dòng)程序。

深入

本指南是對(duì)在使用CircuitPython和displayio庫的三色eInk顯示器上使用位圖圖形和文本的介紹。

其他《 Adafruit學(xué)習(xí)系統(tǒng)指南》提供了制作不同屏幕元素的更多示例。有關(guān)更多信息,請(qǐng)參考以下指南:

Adafruit eInk顯示器突破點(diǎn)

為電子墨水顯示器準(zhǔn)備圖形 p》

使用displayio

支持CircuitPython顯示對(duì)于更多高級(jí)名稱標(biāo)簽,您可以考慮將Adafruit PyBadge與TFT LCD顯示器一起使用

帶有Unicode字體的PyBadge會(huì)議徽章
責(zé)任編輯:wv

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請(qǐng)聯(lián)系本站處理。 舉報(bào)投訴
  • 顯示屏
    +關(guān)注

    關(guān)注

    28

    文章

    4605

    瀏覽量

    76400
收藏 人收藏
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

    評(píng)論

    相關(guān)推薦
    熱點(diǎn)推薦

    LED燈桿與常規(guī)LED顯示屏的區(qū)別

    LED燈桿與常規(guī)LED顯示屏的區(qū)別
    的頭像 發(fā)表于 03-21 08:45 ?404次閱讀
    LED燈桿<b class='flag-5'>屏</b>與常規(guī)LED<b class='flag-5'>顯示屏</b>的區(qū)別

    顯示屏的ESD應(yīng)用方案——顯示屏的發(fā)展史 #jin

    顯示屏
    jf_15747056
    發(fā)布于 :2025年03月10日 18:11:37

    2.0寸顯示屏,輕薄低功耗12864點(diǎn)陣COG顯示屏

    2.0寸單色LCD液晶顯示屏12864圖形點(diǎn)陣,輕薄低功耗128*64點(diǎn)陣COG顯示屏
    的頭像 發(fā)表于 02-19 12:02 ?561次閱讀
    2.0寸<b class='flag-5'>顯示屏</b>,輕薄低功耗12864點(diǎn)陣COG<b class='flag-5'>顯示屏</b>

    #物聯(lián)網(wǎng) LED顯示屏

    LED顯示屏
    斯塔克物聯(lián)科技
    發(fā)布于 :2024年11月01日 14:24:14

    液晶顯示屏是什么材料做的

    液晶顯示屏(Liquid Crystal Display,簡稱LCD)是一種廣泛使用的顯示技術(shù),它利用液晶材料的光學(xué)特性來控制光線的通過,從而實(shí)現(xiàn)圖像的顯示。液晶
    的頭像 發(fā)表于 10-12 10:41 ?3517次閱讀

    液晶顯示屏與led顯示屏的區(qū)別

    在現(xiàn)代電子設(shè)備中,顯示屏是人機(jī)交互的重要界面。隨著科技的發(fā)展,顯示屏技術(shù)也在不斷進(jìn)步,其中液晶顯示屏(LCD)和LED顯示屏是兩種主流的顯示
    的頭像 發(fā)表于 10-12 10:39 ?3484次閱讀

    LED顯示屏如何通過FMEA進(jìn)行風(fēng)險(xiǎn)分析:打造無憂顯示新境界

    體驗(yàn)和品牌形象。因此,通過FMEA進(jìn)行風(fēng)險(xiǎn)分析,提前識(shí)別并消除潛在隱患,對(duì)于保障LED顯示屏的穩(wěn)定運(yùn)行至關(guān)重要。具體步驟如深圳天行健企業(yè)管理咨詢公司下文所述: 確定分析對(duì)象和范圍 首先,明確分析的具體對(duì)象,如LED顯示屏的某個(gè)型
    的頭像 發(fā)表于 09-27 09:59 ?777次閱讀

    物聯(lián)網(wǎng)系統(tǒng)中顯示屏的主要成員_LED顯示屏詳解

    物聯(lián)網(wǎng)系統(tǒng)中為什么要使用LED顯示屏 物聯(lián)網(wǎng)系統(tǒng)中使用LED顯示屏的原因可以歸結(jié)為以下幾個(gè)方面: 信息顯示與交互的直觀性 高亮度與寬視角:LED顯示屏具有高亮度、寬視角的特點(diǎn),能夠在各
    的頭像 發(fā)表于 09-24 11:24 ?962次閱讀
    物聯(lián)網(wǎng)系統(tǒng)中<b class='flag-5'>顯示屏</b>的主要成員_LED<b class='flag-5'>顯示屏</b>詳解

    通用型國產(chǎn)工程機(jī)械顯示屏#顯示屏 #工程機(jī)械 #國產(chǎn)替代

    顯示屏
    長沙碩博電子科技股份有限公司
    發(fā)布于 :2024年09月19日 10:47:24

    P2.5LED顯示屏好還是P3LED顯示屏好?

    好? 一、LED顯示屏 LED顯示屏是一種新型的顯示設(shè)備,其通過發(fā)光二極管的發(fā)光實(shí)現(xiàn)顯示的功能。它具有色彩鮮艷、亮度高、壽命長、能耗低等優(yōu)點(diǎn)
    的頭像 發(fā)表于 08-29 15:33 ?1121次閱讀

    LED透明顯示屏生產(chǎn) 原理 技術(shù) 應(yīng)用

    LED透明顯示屏常指的是硬燈條透明,具有輕薄、通透、播放影像通透絢麗的特點(diǎn)。是對(duì)LED顯示屏產(chǎn)品應(yīng)用的有效延伸和拓展,主要應(yīng)用在建筑玻璃幕墻、櫥窗等領(lǐng)域。下面從生產(chǎn)、原理、技術(shù)及應(yīng)
    的頭像 發(fā)表于 08-29 15:01 ?1070次閱讀

    詳解LED顯示屏的基本結(jié)構(gòu)和控制方式

    體結(jié)構(gòu) LED顯示屏體是顯示信息的核心部分,主要由顯示點(diǎn)陣、行列驅(qū)動(dòng)電路和其他輔助電路組成。顯示
    的頭像 發(fā)表于 07-19 08:49 ?2457次閱讀