Skip to main content

Adafruit ESP32-S2 TFT Feather 的帮助程序库

项目描述

介绍

文件状态 不和谐 构建状态 代码风格:黑色

Adafruit ESP32-S2 TFT Feather 的帮助程序库。

依赖项

此驱动程序取决于:

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

Adafruit ESP32-S2 TFT 羽毛

从 Adafruit 商店购买一个

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

确保在 Python 环境中安装了circup 。如有必要,使用以下命令安装它:

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.show(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.1.6.tar.gz (30.5 kB 查看哈希

已上传 source

内置分布

adafruit_circuitpython_esp32s2tft-1.1.6-py3-none-any.whl (9.9 kB 查看哈希

已上传 py3