Skip to main content

CircuitPython library for Adafruit Trellis boards.

Project description

Introduction

Documentation Status Discord Build Status Code Style: Ruff

This library will allow you to control the LEDs and read button presses on the Adafruit Trellis Board. It will work with a single Trellis board, or with a matrix of up to 8 Trellis boards.

For more details, see the Adafruit Trellis Learn Guide.

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.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-trellis

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-trellis

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-trellis

Usage Example

See examples/trellis_simpletest.py for full usage example.

import time
import busio
from board import SCL, SDA
from adafruit_trellis import Trellis

# Create the I2C interface
i2c = busio.I2C(SCL, SDA)

# Create a Trellis object for each board
trellis = Trellis(i2c) # 0x70 when no I2C address is supplied

# Turn on every LED
print('Turning all LEDs on...')
trellis.led.fill(True)
time.sleep(2)

# Turn off every LED
print('Turning all LEDs off...')
trellis.led.fill(False)
time.sleep(2)

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_trellis-1.3.25.tar.gz (25.0 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_trellis-1.3.25.tar.gz.

File metadata

File hashes

Hashes for adafruit_circuitpython_trellis-1.3.25.tar.gz
Algorithm Hash digest
SHA256 23e5676d92a3d1a29af890c146e8eb66028f396ceb9b64eaf1604d0a5e00b02a
MD5 f9ffa5bd182bd27bfbfcb650be4078b3
BLAKE2b-256 593df3da64d62e9dc63ee75c701d9094f629b7362fa06e920e76b61855e180ba

See more details on using hashes here.

File details

Details for the file adafruit_circuitpython_trellis-1.3.25-py3-none-any.whl.

File metadata

File hashes

Hashes for adafruit_circuitpython_trellis-1.3.25-py3-none-any.whl
Algorithm Hash digest
SHA256 c76ca3511a52e0310ca3f066c34e4ca30ab730f567fba4d0044c13077c0b787f
MD5 79c69104a644aa2d43f2054c6693bb89
BLAKE2b-256 297a107eb6ef40992c6949d6c6c7f3ae45459b4afa50677dad507b5da90fd8a5

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