跳转到主要内容

Adafruit ESP32-S2 TFT Feather 的辅助库

项目描述

简介

Documentation Status Discord Build Status Code Style: Black

Adafruit ESP32-S2 TFT Feather 的辅助库。

依赖项

此驱动程序依赖于

请确保所有依赖项都可在CircuitPython文件系统中使用。这可以通过下载 Adafruit 库和驱动程序包 或使用 circup 安装单独的库轻松实现。

Adafruit ESP32-S2 TFT Feather

在Adafruit商店购买

使用 Circup 将其安装到连接的 CircuitPython 设备上

请确保您已将 circup 安装在您的 Python 环境中。如果需要,请使用以下命令进行安装:

pip3 install circup

安装 circup 并连接您的 CircuitPython 设备后,请使用以下命令进行安装:

circup install adafruit_esp32s2tft

或使用以下命令更新现有版本:

circup update

使用示例

import random
from rainbowio import colorwheel
from adafruit_esp32s2tft import ESP32S2TFT

esp32s2tft = ESP32S2TFT(
    default_bg=0xFFFF00,
    scale=2,
)

# Create the labels
esp32s2tft.add_text(
    text="ESP32-S2", text_position=(10, 10), text_scale=2, text_color=0xFF00FF
)
esp32s2tft.add_text(
    text="TFT Feather",
    text_position=(60, 30),
    text_anchor_point=(0.5, 0.5),
    text_color=0xFF00FF,
)
button_label = esp32s2tft.add_text(
    text="Press BOOT0 Button",
    line_spacing=1.0,
    text_position=(60, 50),
    text_anchor_point=(0.5, 0.5),
    text_color=0x606060,
)
esp32s2tft.display.root_group = esp32s2tft.splash

while True:
    esp32s2tft.set_text_color(
        0xFF0000 if esp32s2tft.peripherals.button else 0x606060, button_label
    )
    esp32s2tft.peripherals.led = esp32s2tft.peripherals.button
    if esp32s2tft.peripherals.button:
        esp32s2tft.peripherals.neopixel[0] = colorwheel(random.randint(0, 255))

文档

此库的 API 文档可在 Read the Docs 上找到。

有关构建库文档的信息,请参阅 本指南

贡献

欢迎贡献!在为本项目做出贡献之前,请阅读我们的行为准则,以帮助本项目保持友好。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分布

adafruit-circuitpython-esp32s2tft-1.2.1.tar.gz (28.8 kB 查看哈希值)

上传时间 源代码

构建分布

由以下支持

AWSAWS云计算和安全赞助商DatadogDatadog监控FastlyFastlyCDNGoogleGoogle下载分析MicrosoftMicrosoftPSF赞助商PingdomPingdom监控SentrySentry错误日志StatusPageStatusPage状态页面