Skip to main content

Helper library for the Adafruit ESP32-S2 TFT Feather

Project description

Introduction

Documentation Status Discord Build Status Code Style: Black

Helper library for the Adafruit ESP32-S2 TFT Feather.

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.

Adafruit ESP32-S2 TFT Feather

Purchase one from the Adafruit shop

Installing to a Connected CircuitPython Device with Circup

Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:

pip3 install circup

With circup installed and your CircuitPython device connected use the following command to install:

circup install adafruit_esp32s2tft

Or the following command to update an existing version:

circup update

Usage Example

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))

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adafruit_circuitpython_esp32s2tft-1.2.3.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file adafruit_circuitpython_esp32s2tft-1.2.3.tar.gz.

File metadata

File hashes

Hashes for adafruit_circuitpython_esp32s2tft-1.2.3.tar.gz
Algorithm Hash digest
SHA256 ae727f3169d22e19988ee97e4f516bb45ff2d7dfd3e69bd1d35beced9ed7c00d
MD5 a138349ae5f1d77622f0c3f0343a7fd2
BLAKE2b-256 eb9e29ec5d41ab4c8b9f4bfdd32e39e09ad7e057560db3abb25ccd8911aed9b3

See more details on using hashes here.

File details

Details for the file adafruit_circuitpython_esp32s2tft-1.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for adafruit_circuitpython_esp32s2tft-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 514aaa40ddc8bc03cc0d432bfed7c0d66e937dfffa2fc3b6d8f64e50cb428733
MD5 24777583d30a789bb00903e07e7cf455
BLAKE2b-256 ac21b263125bd9f69b8cf8a395af0919a4604b847c386f16aeed7c950d452aa1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page