Skip to main content

CircuitPython library for Adafruit Trellis boards.

Project description

Introduction

Documentation Status Discord Build Status Code Style: Black

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.17.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file adafruit-circuitpython-trellis-1.3.17.tar.gz.

File metadata

File hashes

Hashes for adafruit-circuitpython-trellis-1.3.17.tar.gz
Algorithm Hash digest
SHA256 5631283045f115a681b3fe7a6f18c2c52b75b27050d644c0573072ffc3b96272
MD5 f613cd08b2d18d8a76540a3d2626d736
BLAKE2b-256 dcf9574061773d8adf5a8b79d414b19d84e598fc4463abd6feeb413675fecc37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adafruit_circuitpython_trellis-1.3.17-py3-none-any.whl
Algorithm Hash digest
SHA256 1050fa49d33475bd90d0e0d391212c37a067b9f9adac0a7d1bb25ec618001292
MD5 d7005a2aea5eb4aac7f1cfa30b0f73eb
BLAKE2b-256 4255883f1d07dcab0beb0cf6fccef10bd113f5d28ee39198338b51a50eb732c9

See more details on using hashes here.

Supported by

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