Compare commits
No commits in common. "main" and "patch" have entirely different histories.
38 changed files with 860 additions and 3062 deletions
11
.gitattributes
vendored
11
.gitattributes
vendored
|
|
@ -1,11 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Unlicense
|
|
||||||
|
|
||||||
.py text eol=lf
|
|
||||||
.rst text eol=lf
|
|
||||||
.txt text eol=lf
|
|
||||||
.yaml text eol=lf
|
|
||||||
.toml text eol=lf
|
|
||||||
.license text eol=lf
|
|
||||||
.md text eol=lf
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
Thank you for contributing! Before you submit a pull request, please read the following.
|
Thank you for contributing! Before you submit a pull request, please read the following.
|
||||||
|
|
||||||
Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://docs.circuitpython.org/en/latest/docs/design_guide.html
|
Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://circuitpython.readthedocs.io/en/latest/docs/design_guide.html
|
||||||
|
|
||||||
If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs
|
If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs
|
||||||
|
|
||||||
|
|
|
||||||
65
.github/workflows/build.yml
vendored
65
.github/workflows/build.yml
vendored
|
|
@ -10,5 +10,66 @@ jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Run Build CI workflow
|
- name: Dump GitHub context
|
||||||
uses: adafruit/workflows-circuitpython-libs/build@main
|
env:
|
||||||
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
|
run: echo "$GITHUB_CONTEXT"
|
||||||
|
- name: Translate Repo Name For Build Tools filename_prefix
|
||||||
|
id: repo-name
|
||||||
|
run: |
|
||||||
|
echo ::set-output name=repo-name::$(
|
||||||
|
echo ${{ github.repository }} |
|
||||||
|
awk -F '\/' '{ print tolower($2) }' |
|
||||||
|
tr '_' '-'
|
||||||
|
)
|
||||||
|
- name: Set up Python 3.7
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.7
|
||||||
|
- name: Versions
|
||||||
|
run: |
|
||||||
|
python3 --version
|
||||||
|
- name: Checkout Current Repo
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Checkout tools repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: adafruit/actions-ci-circuitpython-libs
|
||||||
|
path: actions-ci
|
||||||
|
- name: Install dependencies
|
||||||
|
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
|
||||||
|
run: |
|
||||||
|
source actions-ci/install.sh
|
||||||
|
- name: Pip install Sphinx, pre-commit
|
||||||
|
run: |
|
||||||
|
pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit
|
||||||
|
- name: Library version
|
||||||
|
run: git describe --dirty --always --tags
|
||||||
|
- name: Pre-commit hooks
|
||||||
|
run: |
|
||||||
|
pre-commit run --all-files
|
||||||
|
- name: Build assets
|
||||||
|
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
|
||||||
|
- name: Archive bundles
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: bundles
|
||||||
|
path: ${{ github.workspace }}/bundles/
|
||||||
|
- name: Build docs
|
||||||
|
working-directory: docs
|
||||||
|
run: sphinx-build -E -W -b html . _build/html
|
||||||
|
- name: Check For setup.py
|
||||||
|
id: need-pypi
|
||||||
|
run: |
|
||||||
|
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
|
||||||
|
- name: Build Python package
|
||||||
|
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||||
|
run: |
|
||||||
|
pip install --upgrade setuptools wheel twine readme_renderer testresources
|
||||||
|
python setup.py sdist
|
||||||
|
python setup.py bdist_wheel --universal
|
||||||
|
twine check dist/*
|
||||||
|
- name: Setup problem matchers
|
||||||
|
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
|
||||||
|
|
|
||||||
85
.github/workflows/release.yml
vendored
Normal file
85
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
name: Release Actions
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
upload-release-assets:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Dump GitHub context
|
||||||
|
env:
|
||||||
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
|
run: echo "$GITHUB_CONTEXT"
|
||||||
|
- name: Translate Repo Name For Build Tools filename_prefix
|
||||||
|
id: repo-name
|
||||||
|
run: |
|
||||||
|
echo ::set-output name=repo-name::$(
|
||||||
|
echo ${{ github.repository }} |
|
||||||
|
awk -F '\/' '{ print tolower($2) }' |
|
||||||
|
tr '_' '-'
|
||||||
|
)
|
||||||
|
- name: Set up Python 3.6
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.6
|
||||||
|
- name: Versions
|
||||||
|
run: |
|
||||||
|
python3 --version
|
||||||
|
- name: Checkout Current Repo
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Checkout tools repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: adafruit/actions-ci-circuitpython-libs
|
||||||
|
path: actions-ci
|
||||||
|
- name: Install deps
|
||||||
|
run: |
|
||||||
|
source actions-ci/install.sh
|
||||||
|
- name: Build assets
|
||||||
|
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
|
||||||
|
- name: Upload Release Assets
|
||||||
|
# the 'official' actions version does not yet support dynamically
|
||||||
|
# supplying asset names to upload. @csexton's version chosen based on
|
||||||
|
# discussion in the issue below, as its the simplest to implement and
|
||||||
|
# allows for selecting files with a pattern.
|
||||||
|
# https://github.com/actions/upload-release-asset/issues/4
|
||||||
|
#uses: actions/upload-release-asset@v1.0.1
|
||||||
|
uses: csexton/release-asset-action@master
|
||||||
|
with:
|
||||||
|
pattern: "bundles/*"
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
upload-pypi:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Check For setup.py
|
||||||
|
id: need-pypi
|
||||||
|
run: |
|
||||||
|
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
|
||||||
|
- name: Set up Python
|
||||||
|
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
- name: Install dependencies
|
||||||
|
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install setuptools wheel twine
|
||||||
|
- name: Build and publish
|
||||||
|
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||||
|
env:
|
||||||
|
TWINE_USERNAME: ${{ secrets.pypi_username }}
|
||||||
|
TWINE_PASSWORD: ${{ secrets.pypi_password }}
|
||||||
|
run: |
|
||||||
|
python setup.py sdist
|
||||||
|
twine upload dist/*
|
||||||
19
.github/workflows/release_gh.yml
vendored
19
.github/workflows/release_gh.yml
vendored
|
|
@ -1,19 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
name: GitHub Release Actions
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
upload-release-assets:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Run GitHub Release CI workflow
|
|
||||||
uses: adafruit/workflows-circuitpython-libs/release-gh@main
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
upload-url: ${{ github.event.release.upload_url }}
|
|
||||||
19
.github/workflows/release_pypi.yml
vendored
19
.github/workflows/release_pypi.yml
vendored
|
|
@ -1,19 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
name: PyPI Release Actions
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
upload-release-assets:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Run PyPI Release CI workflow
|
|
||||||
uses: adafruit/workflows-circuitpython-libs/release-pypi@main
|
|
||||||
with:
|
|
||||||
pypi-username: ${{ secrets.pypi_username }}
|
|
||||||
pypi-password: ${{ secrets.pypi_password }}
|
|
||||||
58
.gitignore
vendored
58
.gitignore
vendored
|
|
@ -1,48 +1,18 @@
|
||||||
# SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries
|
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: Unlicense
|
||||||
|
|
||||||
# Do not include files and directories created by your personal work environment, such as the IDE
|
|
||||||
# you use, except for those already listed here. Pull requests including changes to this file will
|
|
||||||
# not be accepted.
|
|
||||||
|
|
||||||
# This .gitignore file contains rules for files generated by working with CircuitPython libraries,
|
|
||||||
# including building Sphinx, testing with pip, and creating a virual environment, as well as the
|
|
||||||
# MacOS and IDE-specific files generated by using MacOS in general, or the PyCharm or VSCode IDEs.
|
|
||||||
|
|
||||||
# If you find that there are files being generated on your machine that should not be included in
|
|
||||||
# your git commit, you should create a .gitignore_global file on your computer to include the
|
|
||||||
# files created by your personal setup. To do so, follow the two steps below.
|
|
||||||
|
|
||||||
# First, create a file called .gitignore_global somewhere convenient for you, and add rules for
|
|
||||||
# the files you want to exclude from git commits.
|
|
||||||
|
|
||||||
# Second, configure Git to use the exclude file for all Git repositories by running the
|
|
||||||
# following via commandline, replacing "path/to/your/" with the actual path to your newly created
|
|
||||||
# .gitignore_global file:
|
|
||||||
# git config --global core.excludesfile path/to/your/.gitignore_global
|
|
||||||
|
|
||||||
# CircuitPython-specific files
|
|
||||||
*.mpy
|
*.mpy
|
||||||
|
|
||||||
# Python-specific files
|
|
||||||
__pycache__
|
|
||||||
*.pyc
|
|
||||||
|
|
||||||
# Sphinx build-specific files
|
|
||||||
_build
|
|
||||||
|
|
||||||
# This file results from running `pip -e install .` in a local repository
|
|
||||||
*.egg-info
|
|
||||||
|
|
||||||
# Virtual environment-specific files
|
|
||||||
.env
|
|
||||||
.venv
|
|
||||||
|
|
||||||
# MacOS-specific files
|
|
||||||
*.DS_Store
|
|
||||||
|
|
||||||
# IDE-specific files
|
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
__pycache__
|
||||||
*~
|
_build
|
||||||
|
*.pyc
|
||||||
|
.env
|
||||||
|
bundles
|
||||||
|
*.DS_Store
|
||||||
|
.eggs
|
||||||
|
dist
|
||||||
|
**/*.egg-info
|
||||||
|
Pipfile
|
||||||
|
Pipfile.lock
|
||||||
|
.python-version
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,42 @@
|
||||||
# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
|
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Unlicense
|
# SPDX-License-Identifier: Unlicense
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/python/black
|
||||||
rev: v4.5.0
|
rev: 20.8b1
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-yaml
|
- id: black
|
||||||
- id: end-of-file-fixer
|
- repo: https://github.com/fsfe/reuse-tool
|
||||||
- id: trailing-whitespace
|
rev: v0.12.1
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
||||||
rev: v0.3.4
|
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff-format
|
- id: reuse
|
||||||
- id: ruff
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
args: ["--fix"]
|
rev: v2.3.0
|
||||||
- repo: https://github.com/fsfe/reuse-tool
|
|
||||||
rev: v3.0.1
|
|
||||||
hooks:
|
hooks:
|
||||||
- id: reuse
|
- id: check-yaml
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- repo: https://github.com/pycqa/pylint
|
||||||
|
rev: v2.11.1
|
||||||
|
hooks:
|
||||||
|
- id: pylint
|
||||||
|
name: pylint (library code)
|
||||||
|
types: [python]
|
||||||
|
args:
|
||||||
|
- --disable=consider-using-f-string,duplicate-code
|
||||||
|
exclude: "^(docs/|examples/|tests/|setup.py$)"
|
||||||
|
- id: pylint
|
||||||
|
name: pylint (example code)
|
||||||
|
description: Run pylint rules on "examples/*.py" files
|
||||||
|
types: [python]
|
||||||
|
files: "^examples/"
|
||||||
|
args:
|
||||||
|
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code
|
||||||
|
- id: pylint
|
||||||
|
name: pylint (test code)
|
||||||
|
description: Run pylint rules on "tests/*.py" files
|
||||||
|
types: [python]
|
||||||
|
files: "^tests/"
|
||||||
|
args:
|
||||||
|
- --disable=missing-docstring,consider-using-f-string,duplicate-code
|
||||||
|
|
|
||||||
436
.pylintrc
Normal file
436
.pylintrc
Normal file
|
|
@ -0,0 +1,436 @@
|
||||||
|
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Unlicense
|
||||||
|
|
||||||
|
[MASTER]
|
||||||
|
|
||||||
|
# A comma-separated list of package or module names from where C extensions may
|
||||||
|
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||||
|
# run arbitrary code
|
||||||
|
extension-pkg-whitelist=
|
||||||
|
|
||||||
|
# Add files or directories to the blacklist. They should be base names, not
|
||||||
|
# paths.
|
||||||
|
ignore=CVS
|
||||||
|
|
||||||
|
# Add files or directories matching the regex patterns to the blacklist. The
|
||||||
|
# regex matches against base names, not paths.
|
||||||
|
ignore-patterns=
|
||||||
|
|
||||||
|
# Python code to execute, usually for sys.path manipulation such as
|
||||||
|
# pygtk.require().
|
||||||
|
#init-hook=
|
||||||
|
|
||||||
|
# Use multiple processes to speed up Pylint.
|
||||||
|
jobs=1
|
||||||
|
|
||||||
|
# List of plugins (as comma separated values of python modules names) to load,
|
||||||
|
# usually to register additional checkers.
|
||||||
|
load-plugins=
|
||||||
|
|
||||||
|
# Pickle collected data for later comparisons.
|
||||||
|
persistent=yes
|
||||||
|
|
||||||
|
# Specify a configuration file.
|
||||||
|
#rcfile=
|
||||||
|
|
||||||
|
# Allow loading of arbitrary C extensions. Extensions are imported into the
|
||||||
|
# active Python interpreter and may run arbitrary code.
|
||||||
|
unsafe-load-any-extension=no
|
||||||
|
|
||||||
|
|
||||||
|
[MESSAGES CONTROL]
|
||||||
|
|
||||||
|
# Only show warnings with the listed confidence levels. Leave empty to show
|
||||||
|
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
|
||||||
|
confidence=
|
||||||
|
|
||||||
|
# Disable the message, report, category or checker with the given id(s). You
|
||||||
|
# can either give multiple identifiers separated by comma (,) or put this
|
||||||
|
# option multiple times (only on the command line, not in the configuration
|
||||||
|
# file where it should appear only once).You can also use "--disable=all" to
|
||||||
|
# disable everything first and then reenable specific checks. For example, if
|
||||||
|
# you want to run only the similarities checker, you can use "--disable=all
|
||||||
|
# --enable=similarities". If you want to run only the classes checker, but have
|
||||||
|
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||||
|
# --disable=W"
|
||||||
|
# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
|
||||||
|
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation,unspecified-encoding
|
||||||
|
|
||||||
|
# Enable the message, report, category or checker with the given id(s). You can
|
||||||
|
# either give multiple identifier separated by comma (,) or put this option
|
||||||
|
# multiple time (only on the command line, not in the configuration file where
|
||||||
|
# it should appear only once). See also the "--disable" option for examples.
|
||||||
|
enable=
|
||||||
|
|
||||||
|
|
||||||
|
[REPORTS]
|
||||||
|
|
||||||
|
# Python expression which should return a note less than 10 (10 is the highest
|
||||||
|
# note). You have access to the variables errors warning, statement which
|
||||||
|
# respectively contain the number of errors / warnings messages and the total
|
||||||
|
# number of statements analyzed. This is used by the global evaluation report
|
||||||
|
# (RP0004).
|
||||||
|
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
|
||||||
|
|
||||||
|
# Template used to display messages. This is a python new-style format string
|
||||||
|
# used to format the message information. See doc for all details
|
||||||
|
#msg-template=
|
||||||
|
|
||||||
|
# Set the output format. Available formats are text, parseable, colorized, json
|
||||||
|
# and msvs (visual studio).You can also give a reporter class, eg
|
||||||
|
# mypackage.mymodule.MyReporterClass.
|
||||||
|
output-format=text
|
||||||
|
|
||||||
|
# Tells whether to display a full report or only the messages
|
||||||
|
reports=no
|
||||||
|
|
||||||
|
# Activate the evaluation score.
|
||||||
|
score=yes
|
||||||
|
|
||||||
|
|
||||||
|
[REFACTORING]
|
||||||
|
|
||||||
|
# Maximum number of nested blocks for function / method body
|
||||||
|
max-nested-blocks=5
|
||||||
|
|
||||||
|
|
||||||
|
[LOGGING]
|
||||||
|
|
||||||
|
# Logging modules to check that the string format arguments are in logging
|
||||||
|
# function parameter format
|
||||||
|
logging-modules=logging
|
||||||
|
|
||||||
|
|
||||||
|
[SPELLING]
|
||||||
|
|
||||||
|
# Spelling dictionary name. Available dictionaries: none. To make it working
|
||||||
|
# install python-enchant package.
|
||||||
|
spelling-dict=
|
||||||
|
|
||||||
|
# List of comma separated words that should not be checked.
|
||||||
|
spelling-ignore-words=
|
||||||
|
|
||||||
|
# A path to a file that contains private dictionary; one word per line.
|
||||||
|
spelling-private-dict-file=
|
||||||
|
|
||||||
|
# Tells whether to store unknown words to indicated private dictionary in
|
||||||
|
# --spelling-private-dict-file option instead of raising a message.
|
||||||
|
spelling-store-unknown-words=no
|
||||||
|
|
||||||
|
|
||||||
|
[MISCELLANEOUS]
|
||||||
|
|
||||||
|
# List of note tags to take in consideration, separated by a comma.
|
||||||
|
# notes=FIXME,XXX,TODO
|
||||||
|
notes=FIXME,XXX
|
||||||
|
|
||||||
|
|
||||||
|
[TYPECHECK]
|
||||||
|
|
||||||
|
# List of decorators that produce context managers, such as
|
||||||
|
# contextlib.contextmanager. Add to this list to register other decorators that
|
||||||
|
# produce valid context managers.
|
||||||
|
contextmanager-decorators=contextlib.contextmanager
|
||||||
|
|
||||||
|
# List of members which are set dynamically and missed by pylint inference
|
||||||
|
# system, and so shouldn't trigger E1101 when accessed. Python regular
|
||||||
|
# expressions are accepted.
|
||||||
|
generated-members=
|
||||||
|
|
||||||
|
# Tells whether missing members accessed in mixin class should be ignored. A
|
||||||
|
# mixin class is detected if its name ends with "mixin" (case insensitive).
|
||||||
|
ignore-mixin-members=yes
|
||||||
|
|
||||||
|
# This flag controls whether pylint should warn about no-member and similar
|
||||||
|
# checks whenever an opaque object is returned when inferring. The inference
|
||||||
|
# can return multiple potential results while evaluating a Python object, but
|
||||||
|
# some branches might not be evaluated, which results in partial inference. In
|
||||||
|
# that case, it might be useful to still emit no-member and other checks for
|
||||||
|
# the rest of the inferred objects.
|
||||||
|
ignore-on-opaque-inference=yes
|
||||||
|
|
||||||
|
# List of class names for which member attributes should not be checked (useful
|
||||||
|
# for classes with dynamically set attributes). This supports the use of
|
||||||
|
# qualified names.
|
||||||
|
ignored-classes=optparse.Values,thread._local,_thread._local
|
||||||
|
|
||||||
|
# List of module names for which member attributes should not be checked
|
||||||
|
# (useful for modules/projects where namespaces are manipulated during runtime
|
||||||
|
# and thus existing member attributes cannot be deduced by static analysis. It
|
||||||
|
# supports qualified module names, as well as Unix pattern matching.
|
||||||
|
ignored-modules=board
|
||||||
|
|
||||||
|
# Show a hint with possible names when a member name was not found. The aspect
|
||||||
|
# of finding the hint is based on edit distance.
|
||||||
|
missing-member-hint=yes
|
||||||
|
|
||||||
|
# The minimum edit distance a name should have in order to be considered a
|
||||||
|
# similar match for a missing member name.
|
||||||
|
missing-member-hint-distance=1
|
||||||
|
|
||||||
|
# The total number of similar names that should be taken in consideration when
|
||||||
|
# showing a hint for a missing member.
|
||||||
|
missing-member-max-choices=1
|
||||||
|
|
||||||
|
|
||||||
|
[VARIABLES]
|
||||||
|
|
||||||
|
# List of additional names supposed to be defined in builtins. Remember that
|
||||||
|
# you should avoid to define new builtins when possible.
|
||||||
|
additional-builtins=
|
||||||
|
|
||||||
|
# Tells whether unused global variables should be treated as a violation.
|
||||||
|
allow-global-unused-variables=yes
|
||||||
|
|
||||||
|
# List of strings which can identify a callback function by name. A callback
|
||||||
|
# name must start or end with one of those strings.
|
||||||
|
callbacks=cb_,_cb
|
||||||
|
|
||||||
|
# A regular expression matching the name of dummy variables (i.e. expectedly
|
||||||
|
# not used).
|
||||||
|
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
|
||||||
|
|
||||||
|
# Argument names that match this expression will be ignored. Default to name
|
||||||
|
# with leading underscore
|
||||||
|
ignored-argument-names=_.*|^ignored_|^unused_
|
||||||
|
|
||||||
|
# Tells whether we should check for unused import in __init__ files.
|
||||||
|
init-import=no
|
||||||
|
|
||||||
|
# List of qualified module names which can have objects that can redefine
|
||||||
|
# builtins.
|
||||||
|
redefining-builtins-modules=six.moves,future.builtins
|
||||||
|
|
||||||
|
|
||||||
|
[FORMAT]
|
||||||
|
|
||||||
|
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
|
||||||
|
# expected-line-ending-format=
|
||||||
|
expected-line-ending-format=LF
|
||||||
|
|
||||||
|
# Regexp for a line that is allowed to be longer than the limit.
|
||||||
|
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
|
||||||
|
|
||||||
|
# Number of spaces of indent required inside a hanging or continued line.
|
||||||
|
indent-after-paren=4
|
||||||
|
|
||||||
|
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
|
||||||
|
# tab).
|
||||||
|
indent-string=' '
|
||||||
|
|
||||||
|
# Maximum number of characters on a single line.
|
||||||
|
max-line-length=100
|
||||||
|
|
||||||
|
# Maximum number of lines in a module
|
||||||
|
max-module-lines=1000
|
||||||
|
|
||||||
|
# List of optional constructs for which whitespace checking is disabled. `dict-
|
||||||
|
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
|
||||||
|
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
|
||||||
|
# `empty-line` allows space-only lines.
|
||||||
|
no-space-check=trailing-comma,dict-separator
|
||||||
|
|
||||||
|
# Allow the body of a class to be on the same line as the declaration if body
|
||||||
|
# contains single statement.
|
||||||
|
single-line-class-stmt=no
|
||||||
|
|
||||||
|
# Allow the body of an if to be on the same line as the test if there is no
|
||||||
|
# else.
|
||||||
|
single-line-if-stmt=no
|
||||||
|
|
||||||
|
|
||||||
|
[SIMILARITIES]
|
||||||
|
|
||||||
|
# Ignore comments when computing similarities.
|
||||||
|
ignore-comments=yes
|
||||||
|
|
||||||
|
# Ignore docstrings when computing similarities.
|
||||||
|
ignore-docstrings=yes
|
||||||
|
|
||||||
|
# Ignore imports when computing similarities.
|
||||||
|
ignore-imports=yes
|
||||||
|
|
||||||
|
# Minimum lines number of a similarity.
|
||||||
|
min-similarity-lines=4
|
||||||
|
|
||||||
|
|
||||||
|
[BASIC]
|
||||||
|
|
||||||
|
# Naming hint for argument names
|
||||||
|
argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
||||||
|
|
||||||
|
# Regular expression matching correct argument names
|
||||||
|
argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
||||||
|
|
||||||
|
# Naming hint for attribute names
|
||||||
|
attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
||||||
|
|
||||||
|
# Regular expression matching correct attribute names
|
||||||
|
attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
||||||
|
|
||||||
|
# Bad variable names which should always be refused, separated by a comma
|
||||||
|
bad-names=foo,bar,baz,toto,tutu,tata
|
||||||
|
|
||||||
|
# Naming hint for class attribute names
|
||||||
|
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
|
||||||
|
|
||||||
|
# Regular expression matching correct class attribute names
|
||||||
|
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
|
||||||
|
|
||||||
|
# Naming hint for class names
|
||||||
|
# class-name-hint=[A-Z_][a-zA-Z0-9]+$
|
||||||
|
class-name-hint=[A-Z_][a-zA-Z0-9_]+$
|
||||||
|
|
||||||
|
# Regular expression matching correct class names
|
||||||
|
# class-rgx=[A-Z_][a-zA-Z0-9]+$
|
||||||
|
class-rgx=[A-Z_][a-zA-Z0-9_]+$
|
||||||
|
|
||||||
|
# Naming hint for constant names
|
||||||
|
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
|
||||||
|
|
||||||
|
# Regular expression matching correct constant names
|
||||||
|
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
|
||||||
|
|
||||||
|
# Minimum line length for functions/classes that require docstrings, shorter
|
||||||
|
# ones are exempt.
|
||||||
|
docstring-min-length=-1
|
||||||
|
|
||||||
|
# Naming hint for function names
|
||||||
|
function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
||||||
|
|
||||||
|
# Regular expression matching correct function names
|
||||||
|
function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
||||||
|
|
||||||
|
# Good variable names which should always be accepted, separated by a comma
|
||||||
|
# good-names=i,j,k,ex,Run,_
|
||||||
|
good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_
|
||||||
|
|
||||||
|
# Include a hint for the correct naming format with invalid-name
|
||||||
|
include-naming-hint=no
|
||||||
|
|
||||||
|
# Naming hint for inline iteration names
|
||||||
|
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
|
||||||
|
|
||||||
|
# Regular expression matching correct inline iteration names
|
||||||
|
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
|
||||||
|
|
||||||
|
# Naming hint for method names
|
||||||
|
method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
||||||
|
|
||||||
|
# Regular expression matching correct method names
|
||||||
|
method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
||||||
|
|
||||||
|
# Naming hint for module names
|
||||||
|
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
|
||||||
|
|
||||||
|
# Regular expression matching correct module names
|
||||||
|
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
|
||||||
|
|
||||||
|
# Colon-delimited sets of names that determine each other's naming style when
|
||||||
|
# the name regexes allow several styles.
|
||||||
|
name-group=
|
||||||
|
|
||||||
|
# Regular expression which should only match function or class names that do
|
||||||
|
# not require a docstring.
|
||||||
|
no-docstring-rgx=^_
|
||||||
|
|
||||||
|
# List of decorators that produce properties, such as abc.abstractproperty. Add
|
||||||
|
# to this list to register other decorators that produce valid properties.
|
||||||
|
property-classes=abc.abstractproperty
|
||||||
|
|
||||||
|
# Naming hint for variable names
|
||||||
|
variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
||||||
|
|
||||||
|
# Regular expression matching correct variable names
|
||||||
|
variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
||||||
|
|
||||||
|
|
||||||
|
[IMPORTS]
|
||||||
|
|
||||||
|
# Allow wildcard imports from modules that define __all__.
|
||||||
|
allow-wildcard-with-all=no
|
||||||
|
|
||||||
|
# Analyse import fallback blocks. This can be used to support both Python 2 and
|
||||||
|
# 3 compatible code, which means that the block might have code that exists
|
||||||
|
# only in one or another interpreter, leading to false positives when analysed.
|
||||||
|
analyse-fallback-blocks=no
|
||||||
|
|
||||||
|
# Deprecated modules which should not be used, separated by a comma
|
||||||
|
deprecated-modules=optparse,tkinter.tix
|
||||||
|
|
||||||
|
# Create a graph of external dependencies in the given file (report RP0402 must
|
||||||
|
# not be disabled)
|
||||||
|
ext-import-graph=
|
||||||
|
|
||||||
|
# Create a graph of every (i.e. internal and external) dependencies in the
|
||||||
|
# given file (report RP0402 must not be disabled)
|
||||||
|
import-graph=
|
||||||
|
|
||||||
|
# Create a graph of internal dependencies in the given file (report RP0402 must
|
||||||
|
# not be disabled)
|
||||||
|
int-import-graph=
|
||||||
|
|
||||||
|
# Force import order to recognize a module as part of the standard
|
||||||
|
# compatibility libraries.
|
||||||
|
known-standard-library=
|
||||||
|
|
||||||
|
# Force import order to recognize a module as part of a third party library.
|
||||||
|
known-third-party=enchant
|
||||||
|
|
||||||
|
|
||||||
|
[CLASSES]
|
||||||
|
|
||||||
|
# List of method names used to declare (i.e. assign) instance attributes.
|
||||||
|
defining-attr-methods=__init__,__new__,setUp
|
||||||
|
|
||||||
|
# List of member names, which should be excluded from the protected access
|
||||||
|
# warning.
|
||||||
|
exclude-protected=_asdict,_fields,_replace,_source,_make
|
||||||
|
|
||||||
|
# List of valid names for the first argument in a class method.
|
||||||
|
valid-classmethod-first-arg=cls
|
||||||
|
|
||||||
|
# List of valid names for the first argument in a metaclass class method.
|
||||||
|
valid-metaclass-classmethod-first-arg=mcs
|
||||||
|
|
||||||
|
|
||||||
|
[DESIGN]
|
||||||
|
|
||||||
|
# Maximum number of arguments for function / method
|
||||||
|
max-args=5
|
||||||
|
|
||||||
|
# Maximum number of attributes for a class (see R0902).
|
||||||
|
# max-attributes=7
|
||||||
|
max-attributes=11
|
||||||
|
|
||||||
|
# Maximum number of boolean expressions in a if statement
|
||||||
|
max-bool-expr=5
|
||||||
|
|
||||||
|
# Maximum number of branch for function / method body
|
||||||
|
max-branches=12
|
||||||
|
|
||||||
|
# Maximum number of locals for function / method body
|
||||||
|
max-locals=15
|
||||||
|
|
||||||
|
# Maximum number of parents for a class (see R0901).
|
||||||
|
max-parents=7
|
||||||
|
|
||||||
|
# Maximum number of public methods for a class (see R0904).
|
||||||
|
max-public-methods=20
|
||||||
|
|
||||||
|
# Maximum number of return / yield for function / method body
|
||||||
|
max-returns=6
|
||||||
|
|
||||||
|
# Maximum number of statements in function / method body
|
||||||
|
max-statements=50
|
||||||
|
|
||||||
|
# Minimum number of public methods for a class (see R0903).
|
||||||
|
min-public-methods=1
|
||||||
|
|
||||||
|
|
||||||
|
[EXCEPTIONS]
|
||||||
|
|
||||||
|
# Exceptions that will emit a warning when being caught. Defaults to
|
||||||
|
# "Exception"
|
||||||
|
overgeneral-exceptions=Exception
|
||||||
|
|
@ -8,15 +8,8 @@
|
||||||
# Required
|
# Required
|
||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
sphinx:
|
|
||||||
configuration: docs/conf.py
|
|
||||||
|
|
||||||
build:
|
|
||||||
os: ubuntu-lts-latest
|
|
||||||
tools:
|
|
||||||
python: "3"
|
|
||||||
|
|
||||||
python:
|
python:
|
||||||
|
version: "3.6"
|
||||||
install:
|
install:
|
||||||
- requirements: docs/requirements.txt
|
- requirements: docs/requirements.txt
|
||||||
- requirements: requirements.txt
|
- requirements: requirements.txt
|
||||||
|
|
|
||||||
42
README.rst
42
README.rst
|
|
@ -2,10 +2,10 @@ Introduction
|
||||||
============
|
============
|
||||||
|
|
||||||
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-is31fl3741/badge/?version=latest
|
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-is31fl3741/badge/?version=latest
|
||||||
:target: https://docs.circuitpython.org/projects/is31fl3741/en/latest/
|
:target: https://circuitpython.readthedocs.io/projects/is31fl3741/en/latest/
|
||||||
:alt: Documentation Status
|
:alt: Documentation Status
|
||||||
|
|
||||||
.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
|
.. image :: https://img.shields.io/discord/327254708534116352.svg
|
||||||
:target: https://adafru.it/discord
|
:target: https://adafru.it/discord
|
||||||
:alt: Discord
|
:alt: Discord
|
||||||
|
|
||||||
|
|
@ -13,10 +13,6 @@ Introduction
|
||||||
:target: https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3741/actions/
|
:target: https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3741/actions/
|
||||||
:alt: Build Status
|
:alt: Build Status
|
||||||
|
|
||||||
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
||||||
:target: https://github.com/astral-sh/ruff
|
|
||||||
:alt: Code Style: Ruff
|
|
||||||
|
|
||||||
CircuitPython driver for the IS31FL3741 RGB Matrix IC.
|
CircuitPython driver for the IS31FL3741 RGB Matrix IC.
|
||||||
|
|
||||||
This driver supports the following hardware:
|
This driver supports the following hardware:
|
||||||
|
|
@ -53,8 +49,8 @@ To install in a virtual environment in your current project:
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
mkdir project-name && cd project-name
|
mkdir project-name && cd project-name
|
||||||
python3 -m venv .venv
|
python3 -m venv .env
|
||||||
source .venv/bin/activate
|
source .env/bin/activate
|
||||||
pip3 install adafruit-circuitpython-is31fl3741
|
pip3 install adafruit-circuitpython-is31fl3741
|
||||||
|
|
||||||
Usage Example
|
Usage Example
|
||||||
|
|
@ -64,31 +60,18 @@ Matrix:
|
||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
import time
|
from adafruit_is31fl3741.matrix import Matrix
|
||||||
import board
|
import board
|
||||||
import adafruit_is31fl3741
|
import busio
|
||||||
|
with busio.I2C(board.SCL, board.SDA) as i2c:
|
||||||
|
display = Matrix(i2c)
|
||||||
|
display.fill(127)
|
||||||
|
|
||||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
|
||||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
|
||||||
is31 = adafruit_is31fl3741.IS31FL3741(i2c)
|
|
||||||
|
|
||||||
is31.set_led_scaling(0xFF) # turn on LEDs all the way
|
|
||||||
is31.global_current = 0xFF # set current to max
|
|
||||||
is31.enable = True # enable!
|
|
||||||
|
|
||||||
# light up every LED, one at a time
|
|
||||||
while True:
|
|
||||||
for pixel in range(351):
|
|
||||||
is31[pixel] = 255
|
|
||||||
time.sleep(0.01)
|
|
||||||
is31[pixel] = 0
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
=============
|
=============
|
||||||
|
|
||||||
API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/is31fl3741/en/latest/>`_.
|
API documentation for this library can be found on `Read the Docs <https://circuitpython.readthedocs.io/projects/is31fl3741/en/latest/>`_.
|
||||||
|
|
||||||
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
|
|
||||||
|
|
||||||
Contributing
|
Contributing
|
||||||
============
|
============
|
||||||
|
|
@ -96,3 +79,8 @@ Contributing
|
||||||
Contributions are welcome! Please read our `Code of Conduct
|
Contributions are welcome! Please read our `Code of Conduct
|
||||||
<https://github.com/adafruit/Adafruit_CircuitPython_is31fl3741/blob/main/CODE_OF_CONDUCT.md>`_
|
<https://github.com/adafruit/Adafruit_CircuitPython_is31fl3741/blob/main/CODE_OF_CONDUCT.md>`_
|
||||||
before contributing to help this project stay welcoming.
|
before contributing to help this project stay welcoming.
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
=============
|
||||||
|
|
||||||
|
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
|
||||||
|
|
|
||||||
|
|
@ -25,23 +25,20 @@ Implementation Notes
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from sys import implementation
|
from sys import implementation
|
||||||
|
|
||||||
from adafruit_bus_device import i2c_device
|
from adafruit_bus_device import i2c_device
|
||||||
from adafruit_register.i2c_bit import RWBit
|
|
||||||
from adafruit_register.i2c_struct import ROUnaryStruct, UnaryStruct
|
from adafruit_register.i2c_struct import ROUnaryStruct, UnaryStruct
|
||||||
|
from adafruit_register.i2c_bit import RWBit
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Used only for typing
|
# Used only for typing
|
||||||
from typing import Optional, Tuple, Union
|
from typing import Optional, Tuple, Union # pylint: disable=unused-import
|
||||||
|
from PIL.ImageFile import ImageFile
|
||||||
import busio
|
|
||||||
from adafruit_framebuf import FrameBuffer
|
from adafruit_framebuf import FrameBuffer
|
||||||
from circuitpython_typing import ReadableBuffer
|
import busio
|
||||||
from circuitpython_typing.pil import Image
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
__version__ = "0.0.0+auto.0"
|
__version__ = "0.0.0-auto.0"
|
||||||
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3741.git"
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3741.git"
|
||||||
|
|
||||||
_IS3741_ADDR_DEFAULT = 0x30
|
_IS3741_ADDR_DEFAULT = 0x30
|
||||||
|
|
@ -236,19 +233,6 @@ class IS31FL3741:
|
||||||
i2c.write(self._pixel_buffer, start=180, end=352)
|
i2c.write(self._pixel_buffer, start=180, end=352)
|
||||||
self._pixel_buffer[180] = save
|
self._pixel_buffer[180] = save
|
||||||
|
|
||||||
def write(self, mapping: Tuple, buffer: ReadableBuffer) -> None:
|
|
||||||
"""
|
|
||||||
Write buf out on the I2C bus to the IS31FL3741.
|
|
||||||
|
|
||||||
:param mapping: map the pixels in the buffer to the order addressed by the driver chip
|
|
||||||
:param buffer: The bytes to clock out. No assumption is made about color order
|
|
||||||
:return: None
|
|
||||||
"""
|
|
||||||
for pos, data in enumerate(buffer):
|
|
||||||
if mapping[pos] != 65535:
|
|
||||||
self[mapping[pos]] = data
|
|
||||||
self.show()
|
|
||||||
|
|
||||||
|
|
||||||
IS3741_RGB = (0 << 4) | (1 << 2) | (2) # Encode as R,G,B
|
IS3741_RGB = (0 << 4) | (1 << 2) | (2) # Encode as R,G,B
|
||||||
IS3741_RBG = (0 << 4) | (2 << 2) | (1) # Encode as R,B,G
|
IS3741_RBG = (0 << 4) | (2 << 2) | (1) # Encode as R,B,G
|
||||||
|
|
@ -283,6 +267,7 @@ class IS31FL3741_colorXY(IS31FL3741):
|
||||||
above. Default is IS3741_BGR.
|
above. Default is IS3741_BGR.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# pylint: disable-msg=too-many-arguments
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
i2c: busio.I2C,
|
i2c: busio.I2C,
|
||||||
|
|
@ -350,7 +335,7 @@ class IS31FL3741_colorXY(IS31FL3741):
|
||||||
)
|
)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def image(self, img: Union[FrameBuffer, Image]) -> None:
|
def image(self, img: Union[FrameBuffer, ImageFile]) -> None:
|
||||||
"""Copy an in-memory image to the LED matrix. Image should be in
|
"""Copy an in-memory image to the LED matrix. Image should be in
|
||||||
24-bit format (e.g. "RGB888") and dimensions should match matrix,
|
24-bit format (e.g. "RGB888") and dimensions should match matrix,
|
||||||
this isn't super robust yet or anything.
|
this isn't super robust yet or anything.
|
||||||
|
|
@ -368,7 +353,9 @@ class IS31FL3741_colorXY(IS31FL3741):
|
||||||
raise ValueError("Image must be in mode RGB.")
|
raise ValueError("Image must be in mode RGB.")
|
||||||
if img.size[0] != self.width or img.size[1] != self.height:
|
if img.size[0] != self.width or img.size[1] != self.height:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Image must be same dimensions as display ({self.width}x{self.height})."
|
"Image must be same dimensions as display ({0}x{1}).".format(
|
||||||
|
self.width, self.height
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Iterate X/Y through all image pixels
|
# Iterate X/Y through all image pixels
|
||||||
|
|
|
||||||
|
|
@ -22,17 +22,14 @@ Implementation Notes
|
||||||
https://github.com/adafruit/circuitpython/releases
|
https://github.com/adafruit/circuitpython/releases
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
from struct import unpack_from # pylint: disable=no-name-in-module
|
||||||
|
|
||||||
from struct import unpack_from
|
from adafruit_is31fl3741 import _IS3741_ADDR_DEFAULT, NO_BUFFER, IS3741_BGR, MUST_BUFFER
|
||||||
|
|
||||||
from adafruit_is31fl3741 import _IS3741_ADDR_DEFAULT, IS3741_BGR, MUST_BUFFER, NO_BUFFER
|
|
||||||
|
|
||||||
from . import IS31FL3741_colorXY
|
from . import IS31FL3741_colorXY
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Used only for typing
|
# Used only for typing
|
||||||
from typing import Any, Tuple
|
from typing import Tuple, Any # pylint: disable=unused-import
|
||||||
|
|
||||||
import busio
|
import busio
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
@ -92,30 +89,30 @@ class Right_Ring(BaseRing):
|
||||||
"""The right eye ring of the LED glasses"""
|
"""The right eye ring of the LED glasses"""
|
||||||
|
|
||||||
ledmap_bytes = (
|
ledmap_bytes = (
|
||||||
b"\x01\x1f\x00\x1e\x00\x1f"
|
b"\x01\x1F\x00\x1E\x00\x1F"
|
||||||
b"\x01\x16\x00\x00\x00\x01"
|
b"\x01\x16\x00\x00\x00\x01"
|
||||||
b"\x01\x11\x01\x13\x01\x12"
|
b"\x01\x11\x01\x13\x01\x12"
|
||||||
b"\x01\x1a\x01\x1c\x01\x1b"
|
b"\x01\x1A\x01\x1C\x01\x1B"
|
||||||
b"\x01\x0e\x01\x10\x01\x0f"
|
b"\x01\x0E\x01\x10\x01\x0F"
|
||||||
b"\x00\x1b\x00\x1d\x00\x1c"
|
b"\x00\x1B\x00\x1D\x00\x1C"
|
||||||
b"\x00\x17\x00\x19\x00\x18"
|
b"\x00\x17\x00\x19\x00\x18"
|
||||||
b"\x01\x14\x00\x16\x01\x15"
|
b"\x01\x14\x00\x16\x01\x15"
|
||||||
b"\x00\x14\x00\x1a\x00\x15"
|
b"\x00\x14\x00\x1A\x00\x15"
|
||||||
b"\x00\x32\x00\x38\x00\x33"
|
b"\x00\x32\x00\x38\x00\x33"
|
||||||
b"\x00\x50\x00\x56\x00\x51"
|
b"\x00\x50\x00\x56\x00\x51"
|
||||||
b"\x00\x6e\x00\x74\x00\x6f"
|
b"\x00\x6E\x00\x74\x00\x6F"
|
||||||
b"\x00\x8c\x00\x92\x00\x8d"
|
b"\x00\x8C\x00\x92\x00\x8D"
|
||||||
b"\x00\xaa\x00\xb0\x00\xab"
|
b"\x00\xAA\x00\xB0\x00\xAB"
|
||||||
b"\x00\xc8\x00\xce\x00\xc9"
|
b"\x00\xC8\x00\xCE\x00\xC9"
|
||||||
b"\x00\xe6\x00\xec\x00\xe7"
|
b"\x00\xE6\x00\xEC\x00\xE7"
|
||||||
b"\x01\x04\x01\x0a\x01\x05"
|
b"\x01\x04\x01\x0A\x01\x05"
|
||||||
b"\x01\x5c\x01\x06\x01\x5d"
|
b"\x01\x5C\x01\x06\x01\x5D"
|
||||||
b"\x00\xe9\x00\xeb\x00\xea"
|
b"\x00\xE9\x00\xEB\x00\xEA"
|
||||||
b"\x00\xed\x00\xef\x00\xee"
|
b"\x00\xED\x00\xEF\x00\xEE"
|
||||||
b"\x01\x53\x00\xe8\x01\x54"
|
b"\x01\x53\x00\xE8\x01\x54"
|
||||||
b"\x01\x47\x01\x49\x01\x48"
|
b"\x01\x47\x01\x49\x01\x48"
|
||||||
b"\x01\x31\x00\x5a\x00\x5b"
|
b"\x01\x31\x00\x5A\x00\x5B"
|
||||||
b"\x01\x28\x00\x3c\x00\x3d"
|
b"\x01\x28\x00\x3C\x00\x3D"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -123,30 +120,30 @@ class Left_Ring(BaseRing):
|
||||||
"""The left eye ring of the LED glasses"""
|
"""The left eye ring of the LED glasses"""
|
||||||
|
|
||||||
ledmap_bytes = (
|
ledmap_bytes = (
|
||||||
b"\x01\x55\x00\xd2\x00\xd3"
|
b"\x01\x55\x00\xD2\x00\xD3"
|
||||||
b"\x01\x4c\x00\xb4\x00\xb5"
|
b"\x01\x4C\x00\xB4\x00\xB5"
|
||||||
b"\x01\x43\x00\x96\x00\x97"
|
b"\x01\x43\x00\x96\x00\x97"
|
||||||
b"\x00\x7f\x00\x7d\x00\x7e"
|
b"\x00\x7F\x00\x7D\x00\x7E"
|
||||||
b"\x00\x9a\x00\x98\x00\x99"
|
b"\x00\x9A\x00\x98\x00\x99"
|
||||||
b"\x00\xa3\x00\xa1\x00\xa2"
|
b"\x00\xA3\x00\xA1\x00\xA2"
|
||||||
b"\x00\xa6\x00\xa4\x00\xa5"
|
b"\x00\xA6\x00\xA4\x00\xA5"
|
||||||
b"\x00\xf4\x00\xf2\x00\xf3"
|
b"\x00\xF4\x00\xF2\x00\xF3"
|
||||||
b"\x01\x03\x01\x01\x01\x02"
|
b"\x01\x03\x01\x01\x01\x02"
|
||||||
b"\x00\xa9\x00\xa7\x00\xa8"
|
b"\x00\xA9\x00\xA7\x00\xA8"
|
||||||
b"\x00\x8b\x00\x89\x00\x8a"
|
b"\x00\x8B\x00\x89\x00\x8A"
|
||||||
b"\x00\x6d\x00\x6b\x00\x6c"
|
b"\x00\x6D\x00\x6B\x00\x6C"
|
||||||
b"\x00\x4f\x00\x4d\x00\x4e"
|
b"\x00\x4F\x00\x4D\x00\x4E"
|
||||||
b"\x00\x31\x00\x2f\x00\x30"
|
b"\x00\x31\x00\x2F\x00\x30"
|
||||||
b"\x00\xc7\x00\xc5\x00\xc6"
|
b"\x00\xC7\x00\xC5\x00\xC6"
|
||||||
b"\x00\xe5\x00\xe3\x00\xe4"
|
b"\x00\xE5\x00\xE3\x00\xE4"
|
||||||
b"\x00\x13\x00\x11\x00\x12"
|
b"\x00\x13\x00\x11\x00\x12"
|
||||||
b"\x00\x04\x00\x02\x00\x03"
|
b"\x00\x04\x00\x02\x00\x03"
|
||||||
b"\x00\x10\x00\x0e\x00\x0f"
|
b"\x00\x10\x00\x0E\x00\x0F"
|
||||||
b"\x00\x0d\x00\x0b\x00\x0c"
|
b"\x00\x0D\x00\x0B\x00\x0C"
|
||||||
b"\x00\x0a\x00\x08\x00\x09"
|
b"\x00\x0A\x00\x08\x00\x09"
|
||||||
b"\x00\xd9\x00\xd7\x00\xd8"
|
b"\x00\xD9\x00\xD7\x00\xD8"
|
||||||
b"\x00\x07\x00\x05\x00\x06"
|
b"\x00\x07\x00\x05\x00\x06"
|
||||||
b"\x01\x5e\x00\xf0\x00\xf1"
|
b"\x01\x5E\x00\xF0\x00\xF1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -157,94 +154,94 @@ class LED_Glasses(IS31FL3741_colorXY):
|
||||||
# 120, 121 and 314 (elements unused by the glasses, which has 116 RGB
|
# 120, 121 and 314 (elements unused by the glasses, which has 116 RGB
|
||||||
# LEDs of a possible 117).
|
# LEDs of a possible 117).
|
||||||
ledmap_bytes = (
|
ledmap_bytes = (
|
||||||
b"\x00\x78\x00\x79\x01\x3a"
|
b"\x00\x78\x00\x79\x01\x3A"
|
||||||
b"\x00\x0a\x00\x08\x00\x09"
|
b"\x00\x0A\x00\x08\x00\x09"
|
||||||
b"\x00\x0d\x00\x0b\x00\x0c"
|
b"\x00\x0D\x00\x0B\x00\x0C"
|
||||||
b"\x00\x10\x00\x0e\x00\x0f"
|
b"\x00\x10\x00\x0E\x00\x0F"
|
||||||
b"\x00\x04\x00\x02\x00\x03"
|
b"\x00\x04\x00\x02\x00\x03"
|
||||||
b"\x00\xd9\x00\xd7\x00\xd8"
|
b"\x00\xD9\x00\xD7\x00\xD8"
|
||||||
b"\x00\xdc\x00\xda\x00\xdb"
|
b"\x00\xDC\x00\xDA\x00\xDB"
|
||||||
b"\x00\xdf\x00\xdd\x00\xde"
|
b"\x00\xDF\x00\xDD\x00\xDE"
|
||||||
b"\x00\xe2\x00\xe0\x00\xe1"
|
b"\x00\xE2\x00\xE0\x00\xE1"
|
||||||
b"\x00\xd6\x00\xd4\x00\xd5"
|
b"\x00\xD6\x00\xD4\x00\xD5"
|
||||||
b"\x00\xbb\x00\xb9\x00\xba"
|
b"\x00\xBB\x00\xB9\x00\xBA"
|
||||||
b"\x00\xbe\x00\xbc\x00\xbd"
|
b"\x00\xBE\x00\xBC\x00\xBD"
|
||||||
b"\x00\xc1\x00\xbf\x00\xc0"
|
b"\x00\xC1\x00\xBF\x00\xC0"
|
||||||
b"\x00\xc4\x00\xc2\x00\xc3"
|
b"\x00\xC4\x00\xC2\x00\xC3"
|
||||||
b"\x00\xb8\x00\xb6\x00\xb7"
|
b"\x00\xB8\x00\xB6\x00\xB7"
|
||||||
b"\x00\x25\x00\x23\x00\x24"
|
b"\x00\x25\x00\x23\x00\x24"
|
||||||
b"\x00\x28\x00\x26\x00\x27"
|
b"\x00\x28\x00\x26\x00\x27"
|
||||||
b"\x00\x2b\x00\x29\x00\x2a"
|
b"\x00\x2B\x00\x29\x00\x2A"
|
||||||
b"\x00\x2e\x00\x2c\x00\x2d"
|
b"\x00\x2E\x00\x2C\x00\x2D"
|
||||||
b"\x00\x22\x00\x20\x00\x21"
|
b"\x00\x22\x00\x20\x00\x21"
|
||||||
b"\x00\x43\x00\x41\x00\x42"
|
b"\x00\x43\x00\x41\x00\x42"
|
||||||
b"\x00\x46\x00\x44\x00\x45"
|
b"\x00\x46\x00\x44\x00\x45"
|
||||||
b"\x00\x49\x00\x47\x00\x48"
|
b"\x00\x49\x00\x47\x00\x48"
|
||||||
b"\x00\x4c\x00\x4a\x00\x4b"
|
b"\x00\x4C\x00\x4A\x00\x4B"
|
||||||
b"\x00\x40\x00\x3e\x00\x3f"
|
b"\x00\x40\x00\x3E\x00\x3F"
|
||||||
b"\x00\x61\x00\x5f\x00\x60"
|
b"\x00\x61\x00\x5F\x00\x60"
|
||||||
b"\x00\x64\x00\x62\x00\x63"
|
b"\x00\x64\x00\x62\x00\x63"
|
||||||
b"\x00\x67\x00\x65\x00\x66"
|
b"\x00\x67\x00\x65\x00\x66"
|
||||||
b"\x00\x6a\x00\x68\x00\x69"
|
b"\x00\x6A\x00\x68\x00\x69"
|
||||||
b"\x00\x5e\x00\x5c\x00\x5d"
|
b"\x00\x5E\x00\x5C\x00\x5D"
|
||||||
b"\x00\x7f\x00\x7d\x00\x7e"
|
b"\x00\x7F\x00\x7D\x00\x7E"
|
||||||
b"\x00\x82\x00\x80\x00\x81"
|
b"\x00\x82\x00\x80\x00\x81"
|
||||||
b"\x00\x85\x00\x83\x00\x84"
|
b"\x00\x85\x00\x83\x00\x84"
|
||||||
b"\x00\x88\x00\x86\x00\x87"
|
b"\x00\x88\x00\x86\x00\x87"
|
||||||
b"\x00\x7c\x00\x7a\x00\x7b"
|
b"\x00\x7C\x00\x7A\x00\x7B"
|
||||||
b"\x00\x9d\x00\x9b\x00\x9c"
|
b"\x00\x9D\x00\x9B\x00\x9C"
|
||||||
b"\x00\xa0\x00\x9e\x00\x9f"
|
b"\x00\xA0\x00\x9E\x00\x9F"
|
||||||
b"\x00\xa3\x00\xa1\x00\xa2"
|
b"\x00\xA3\x00\xA1\x00\xA2"
|
||||||
b"\x00\xa6\x00\xa4\x00\xa5"
|
b"\x00\xA6\x00\xA4\x00\xA5"
|
||||||
b"\x00\xf4\x00\xf2\x00\xf3"
|
b"\x00\xF4\x00\xF2\x00\xF3"
|
||||||
b"\x00\xf7\x00\xf5\x00\xf6"
|
b"\x00\xF7\x00\xF5\x00\xF6"
|
||||||
b"\x00\xfa\x00\xf8\x00\xf9"
|
b"\x00\xFA\x00\xF8\x00\xF9"
|
||||||
b"\x00\xfd\x00\xfb\x00\xfc"
|
b"\x00\xFD\x00\xFB\x00\xFC"
|
||||||
b"\x01\x00\x00\xfe\x00\xff"
|
b"\x01\x00\x00\xFE\x00\xFF"
|
||||||
b"\x00\x78\x00\x79\x01\x3a"
|
b"\x00\x78\x00\x79\x01\x3A"
|
||||||
b"\x01\x59\x01\x5b\x01\x5a"
|
b"\x01\x59\x01\x5B\x01\x5A"
|
||||||
b"\x01\x56\x01\x58\x01\x57"
|
b"\x01\x56\x01\x58\x01\x57"
|
||||||
b"\x01\x0b\x01\x0d\x01\x0c"
|
b"\x01\x0B\x01\x0D\x01\x0C"
|
||||||
b"\x01\x07\x01\x09\x01\x08"
|
b"\x01\x07\x01\x09\x01\x08"
|
||||||
b"\x00\x78\x00\x79\x01\x3a"
|
b"\x00\x78\x00\x79\x01\x3A"
|
||||||
b"\x01\x50\x01\x52\x01\x51"
|
b"\x01\x50\x01\x52\x01\x51"
|
||||||
b"\x01\x4d\x01\x4f\x01\x4e"
|
b"\x01\x4D\x01\x4F\x01\x4E"
|
||||||
b"\x00\xed\x00\xef\x00\xee"
|
b"\x00\xED\x00\xEF\x00\xEE"
|
||||||
b"\x00\xe9\x00\xeb\x00\xea"
|
b"\x00\xE9\x00\xEB\x00\xEA"
|
||||||
b"\x01\x5c\x01\x06\x01\x5d"
|
b"\x01\x5C\x01\x06\x01\x5D"
|
||||||
b"\x01\x47\x01\x49\x01\x48"
|
b"\x01\x47\x01\x49\x01\x48"
|
||||||
b"\x01\x44\x01\x46\x01\x45"
|
b"\x01\x44\x01\x46\x01\x45"
|
||||||
b"\x00\xcf\x00\xd1\x00\xd0"
|
b"\x00\xCF\x00\xD1\x00\xD0"
|
||||||
b"\x00\xcb\x00\xcd\x00\xcc"
|
b"\x00\xCB\x00\xCD\x00\xCC"
|
||||||
b"\x01\x4a\x00\xca\x01\x4b"
|
b"\x01\x4A\x00\xCA\x01\x4B"
|
||||||
b"\x01\x3e\x01\x40\x01\x3f"
|
b"\x01\x3E\x01\x40\x01\x3F"
|
||||||
b"\x01\x3b\x01\x3d\x01\x3c"
|
b"\x01\x3B\x01\x3D\x01\x3C"
|
||||||
b"\x00\xb1\x00\xb3\x00\xb2"
|
b"\x00\xB1\x00\xB3\x00\xB2"
|
||||||
b"\x00\xad\x00\xaf\x00\xae"
|
b"\x00\xAD\x00\xAF\x00\xAE"
|
||||||
b"\x01\x41\x00\xac\x01\x42"
|
b"\x01\x41\x00\xAC\x01\x42"
|
||||||
b"\x01\x35\x01\x37\x01\x36"
|
b"\x01\x35\x01\x37\x01\x36"
|
||||||
b"\x01\x32\x01\x34\x01\x33"
|
b"\x01\x32\x01\x34\x01\x33"
|
||||||
b"\x00\x93\x00\x95\x00\x94"
|
b"\x00\x93\x00\x95\x00\x94"
|
||||||
b"\x00\x8f\x00\x91\x00\x90"
|
b"\x00\x8F\x00\x91\x00\x90"
|
||||||
b"\x01\x38\x00\x8e\x01\x39"
|
b"\x01\x38\x00\x8E\x01\x39"
|
||||||
b"\x01\x2c\x01\x2e\x01\x2d"
|
b"\x01\x2C\x01\x2E\x01\x2D"
|
||||||
b"\x01\x29\x01\x2b\x01\x2a"
|
b"\x01\x29\x01\x2B\x01\x2A"
|
||||||
b"\x00\x75\x00\x77\x00\x76"
|
b"\x00\x75\x00\x77\x00\x76"
|
||||||
b"\x00\x71\x00\x73\x00\x72"
|
b"\x00\x71\x00\x73\x00\x72"
|
||||||
b"\x01\x2f\x00\x70\x01\x30"
|
b"\x01\x2F\x00\x70\x01\x30"
|
||||||
b"\x01\x23\x01\x25\x01\x24"
|
b"\x01\x23\x01\x25\x01\x24"
|
||||||
b"\x01\x20\x01\x22\x01\x21"
|
b"\x01\x20\x01\x22\x01\x21"
|
||||||
b"\x00\x57\x00\x59\x00\x58"
|
b"\x00\x57\x00\x59\x00\x58"
|
||||||
b"\x00\x53\x00\x55\x00\x54"
|
b"\x00\x53\x00\x55\x00\x54"
|
||||||
b"\x01\x26\x00\x52\x01\x27"
|
b"\x01\x26\x00\x52\x01\x27"
|
||||||
b"\x01\x1a\x01\x1c\x01\x1b"
|
b"\x01\x1A\x01\x1C\x01\x1B"
|
||||||
b"\x01\x17\x01\x19\x01\x18"
|
b"\x01\x17\x01\x19\x01\x18"
|
||||||
b"\x00\x39\x00\x3b\x00\x3a"
|
b"\x00\x39\x00\x3B\x00\x3A"
|
||||||
b"\x00\x35\x00\x37\x00\x36"
|
b"\x00\x35\x00\x37\x00\x36"
|
||||||
b"\x01\x1d\x00\x34\x01\x1e"
|
b"\x01\x1D\x00\x34\x01\x1E"
|
||||||
b"\x00\x78\x00\x79\x01\x3a"
|
b"\x00\x78\x00\x79\x01\x3A"
|
||||||
b"\x01\x0e\x01\x10\x01\x0f"
|
b"\x01\x0E\x01\x10\x01\x0F"
|
||||||
b"\x00\x1b\x00\x1d\x00\x1c"
|
b"\x00\x1B\x00\x1D\x00\x1C"
|
||||||
b"\x00\x17\x00\x19\x00\x18"
|
b"\x00\x17\x00\x19\x00\x18"
|
||||||
b"\x01\x14\x00\x16\x01\x15"
|
b"\x01\x14\x00\x16\x01\x15"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -24,14 +24,12 @@ Implementation Notes
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# imports
|
# imports
|
||||||
from adafruit_is31fl3741 import _IS3741_ADDR_DEFAULT, IS3741_BGR, NO_BUFFER
|
from adafruit_is31fl3741 import _IS3741_ADDR_DEFAULT, NO_BUFFER, IS3741_BGR
|
||||||
|
|
||||||
from . import IS31FL3741_colorXY
|
from . import IS31FL3741_colorXY
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Used only for typing
|
# Used only for typing
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
|
||||||
import busio
|
import busio
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -1,157 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2016 Damien P. George
|
|
||||||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft for Adafruit Industries
|
|
||||||
# SPDX-FileCopyrightText: 2019 Carter Nelson
|
|
||||||
# SPDX-FileCopyrightText: 2019 Rose Hooper
|
|
||||||
# SPDX-FileCopyrightText: 2021 Mark Komus
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
#
|
|
||||||
# Based on the Neopixel python library
|
|
||||||
|
|
||||||
"""
|
|
||||||
`is31fl3741_pixelbuf` - IS31FL3741 PixelBuf driver
|
|
||||||
====================================================
|
|
||||||
|
|
||||||
* Author(s): Mark Komus, Damien P. George, Scott Shawcroft, Carter Nelson, Rose Hooper
|
|
||||||
"""
|
|
||||||
|
|
||||||
import adafruit_pixelbuf
|
|
||||||
|
|
||||||
try:
|
|
||||||
# Used only for typing
|
|
||||||
from types import TracebackType
|
|
||||||
from typing import Optional, Type, Union
|
|
||||||
|
|
||||||
import is31fl3741
|
|
||||||
|
|
||||||
from . import IS31FL3741
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
__version__ = "0.0.0+auto.0"
|
|
||||||
# __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3741.git"
|
|
||||||
|
|
||||||
|
|
||||||
# Pixel color order constants
|
|
||||||
BGR = "BGR"
|
|
||||||
"""Blue Green Red"""
|
|
||||||
RGB = "RGB"
|
|
||||||
"""Red Green Blue"""
|
|
||||||
GRB = "GRB"
|
|
||||||
"""Green Red Blue"""
|
|
||||||
RGBW = "RGBW"
|
|
||||||
"""Red Green Blue White"""
|
|
||||||
GRBW = "GRBW"
|
|
||||||
"""Green Red Blue White"""
|
|
||||||
|
|
||||||
|
|
||||||
class IS31FL3741_PixelBuf(adafruit_pixelbuf.PixelBuf):
|
|
||||||
"""
|
|
||||||
A sequence of LEDs controlled by an IS31FL3741 driver.
|
|
||||||
|
|
||||||
:param ~is31fl3741.IS31FL3741 is31: the IS31FL3741 device to output with
|
|
||||||
:param ~Tuple[int, ...] mapping: map the pixels in the buffer to the order addressed
|
|
||||||
by the driver chip
|
|
||||||
:param int bpp: Bytes per pixel. 3 for RGB and 4 for RGBW pixels.
|
|
||||||
:param float brightness: Brightness of the pixels between 0.0 and 1.0 where 1.0 is full
|
|
||||||
brightness
|
|
||||||
:param bool auto_write: True if the neopixels should immediately change when set. If False,
|
|
||||||
`show` must be called explicitly.
|
|
||||||
:param str pixel_order: Set the pixel color channel order. GRBW is set by default.
|
|
||||||
:param bool init: True if the IS31FL3741 chip should be initialized.
|
|
||||||
|
|
||||||
.. py:method:: IS31FL3741_PixelBuf.show()
|
|
||||||
|
|
||||||
Shows the new colors on the pixels themselves if they haven't already
|
|
||||||
been autowritten.
|
|
||||||
|
|
||||||
The colors may or may not be showing after this function returns because
|
|
||||||
it may be done asynchronously.
|
|
||||||
|
|
||||||
.. py:method:: IS31FL3741_PixelBuf.fill(color)
|
|
||||||
|
|
||||||
Colors all pixels the given ***color***.
|
|
||||||
|
|
||||||
.. py:attribute:: brightness
|
|
||||||
|
|
||||||
Overall brightness of the pixels (0 to 1.0)
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(
|
|
||||||
self,
|
|
||||||
is31: Union[is31fl3741.IS31FL3741, IS31FL3741],
|
|
||||||
mapping: tuple,
|
|
||||||
*,
|
|
||||||
addr: int = 0x30,
|
|
||||||
bpp: int = 3,
|
|
||||||
brightness: float = 1.0,
|
|
||||||
auto_write: bool = True,
|
|
||||||
pixel_order: str = None,
|
|
||||||
init: bool = True,
|
|
||||||
):
|
|
||||||
if not pixel_order:
|
|
||||||
pixel_order = BGR if bpp == 3 else GRBW
|
|
||||||
elif isinstance(pixel_order, tuple):
|
|
||||||
order_list = [RGBW[order] for order in pixel_order]
|
|
||||||
pixel_order = "".join(order_list)
|
|
||||||
|
|
||||||
n = int(len(mapping) / 3)
|
|
||||||
|
|
||||||
super().__init__(n, brightness=brightness, byteorder=pixel_order, auto_write=auto_write)
|
|
||||||
|
|
||||||
self.is31fl3741 = is31
|
|
||||||
self.addr = addr
|
|
||||||
if not isinstance(mapping, tuple):
|
|
||||||
raise AttributeError("Mapping must be a tuple")
|
|
||||||
self.mapping = mapping
|
|
||||||
|
|
||||||
if init is True:
|
|
||||||
self.initialize()
|
|
||||||
|
|
||||||
def deinit(self) -> None:
|
|
||||||
"""Blank out the LEDs."""
|
|
||||||
self.fill(0)
|
|
||||||
self.show()
|
|
||||||
|
|
||||||
def __enter__(self):
|
|
||||||
return self
|
|
||||||
|
|
||||||
def __exit__(
|
|
||||||
self,
|
|
||||||
exception_type: Optional[Type[BaseException]],
|
|
||||||
exception_value: Optional[BaseException],
|
|
||||||
traceback: Optional[TracebackType],
|
|
||||||
):
|
|
||||||
self.deinit()
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return "[" + ", ".join([str(x) for x in self]) + "]"
|
|
||||||
|
|
||||||
def initialize(self) -> None:
|
|
||||||
"""Initialize"""
|
|
||||||
self.is31fl3741.reset()
|
|
||||||
|
|
||||||
# Set scaling for all LEDs to maximum
|
|
||||||
for led in range(352):
|
|
||||||
self.is31fl3741.set_led(led, 0xFF, 2)
|
|
||||||
|
|
||||||
self.is31fl3741.set_global_current(0xFE)
|
|
||||||
self.is31fl3741.enable()
|
|
||||||
|
|
||||||
@property
|
|
||||||
def n(self) -> int:
|
|
||||||
"""
|
|
||||||
The number of LEDs in the chain (read-only)
|
|
||||||
"""
|
|
||||||
return len(self)
|
|
||||||
|
|
||||||
def write(self) -> None:
|
|
||||||
""".. deprecated: 1.0.0
|
|
||||||
|
|
||||||
Use ``show`` instead. It matches Micro:Bit and Arduino APIs."""
|
|
||||||
self.show()
|
|
||||||
|
|
||||||
def _transmit(self, buffer: bytearray) -> None:
|
|
||||||
self.is31fl3741.write(self.mapping, buffer)
|
|
||||||
|
|
@ -27,12 +27,12 @@ Implementation Notes
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# imports
|
# imports
|
||||||
from adafruit_is31fl3741 import _IS3741_ADDR_DEFAULT, IS3741_BGR, NO_BUFFER, IS31FL3741_colorXY
|
from adafruit_is31fl3741 import _IS3741_ADDR_DEFAULT, NO_BUFFER, IS3741_BGR
|
||||||
|
from adafruit_is31fl3741 import IS31FL3741_colorXY
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Used only for typing
|
# Used only for typing
|
||||||
from typing import Tuple
|
from typing import Tuple # pylint: disable=unused-import
|
||||||
|
|
||||||
import busio
|
import busio
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
"""
|
"""
|
||||||
LED Animation compatibility layer.
|
LED Animation compatibility layer.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import array
|
import array
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -14,6 +13,7 @@ def _int_as_tuple(value):
|
||||||
|
|
||||||
|
|
||||||
def _setup_pixels(grid, led_glasses, left, left_start, right, right_start):
|
def _setup_pixels(grid, led_glasses, left, left_start, right, right_start):
|
||||||
|
# pylint: disable=too-many-locals, too-many-arguments
|
||||||
left_right_size = 24
|
left_right_size = 24
|
||||||
order = [
|
order = [
|
||||||
(left, "l", led_glasses.left_ring),
|
(left, "l", led_glasses.left_ring),
|
||||||
|
|
@ -54,13 +54,16 @@ class LED_Glasses_Animation:
|
||||||
left_start=21,
|
left_start=21,
|
||||||
right_start=8,
|
right_start=8,
|
||||||
):
|
):
|
||||||
|
# pylint: disable=too-many-arguments
|
||||||
self._glasses = led_glasses
|
self._glasses = led_glasses
|
||||||
|
|
||||||
# improvements:
|
# improvements:
|
||||||
# Over, Under, Overlap, Not.
|
# Over, Under, Overlap, Not.
|
||||||
# Left Start, Right Start, Grid Order
|
# Left Start, Right Start, Grid Order
|
||||||
|
|
||||||
sequence = _setup_pixels(grid, led_glasses, left, left_start, right, right_start)
|
sequence = _setup_pixels(
|
||||||
|
grid, led_glasses, left, left_start, right, right_start
|
||||||
|
)
|
||||||
|
|
||||||
self.brightness = brightness
|
self.brightness = brightness
|
||||||
self.auto_write = auto_write
|
self.auto_write = auto_write
|
||||||
|
|
@ -102,7 +105,9 @@ class LED_Glasses_Animation:
|
||||||
if isinstance(key, slice):
|
if isinstance(key, slice):
|
||||||
for idx, val in zip(self._range_for_slice(key), value):
|
for idx, val in zip(self._range_for_slice(key), value):
|
||||||
r, g, b = self._map_pixel(idx)
|
r, g, b = self._map_pixel(idx)
|
||||||
self._glasses[r], self._glasses[g], self._glasses[b] = _int_as_tuple(val)
|
self._glasses[r], self._glasses[g], self._glasses[b] = _int_as_tuple(
|
||||||
|
val
|
||||||
|
)
|
||||||
return
|
return
|
||||||
r, g, b = self._map_pixel(key)
|
r, g, b = self._map_pixel(key)
|
||||||
self._glasses[r], self._glasses[g], self._glasses[b] = _int_as_tuple(value)
|
self._glasses[r], self._glasses[g], self._glasses[b] = _int_as_tuple(value)
|
||||||
|
|
|
||||||
|
|
@ -1,859 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2021 Mark Komus
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
"""
|
|
||||||
LED glasses mappings
|
|
||||||
"""
|
|
||||||
# Maps to link IS31FL3741 LEDs to pixels
|
|
||||||
|
|
||||||
# Full LED glasses 18 x 5 matrix
|
|
||||||
glassesmatrix_ledmap = (
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (0,0) (clipped, corner)
|
|
||||||
10,
|
|
||||||
8,
|
|
||||||
9, # (0,1) / right ring pixel 20
|
|
||||||
13,
|
|
||||||
11,
|
|
||||||
12, # (0,2) / 19
|
|
||||||
16,
|
|
||||||
14,
|
|
||||||
15, # (0,3) / 18
|
|
||||||
4,
|
|
||||||
2,
|
|
||||||
3, # (0,4) / 17
|
|
||||||
217,
|
|
||||||
215,
|
|
||||||
216, # (1,0) / right ring pixel #21
|
|
||||||
220,
|
|
||||||
218,
|
|
||||||
219, # (1,1)
|
|
||||||
223,
|
|
||||||
221,
|
|
||||||
222, # (1,2)
|
|
||||||
226,
|
|
||||||
224,
|
|
||||||
225, # (1,3)
|
|
||||||
214,
|
|
||||||
212,
|
|
||||||
213, # (1,4)
|
|
||||||
187,
|
|
||||||
185,
|
|
||||||
186, # (2,0)
|
|
||||||
190,
|
|
||||||
188,
|
|
||||||
189, # (2,1)
|
|
||||||
193,
|
|
||||||
191,
|
|
||||||
192, # (2,2)
|
|
||||||
196,
|
|
||||||
194,
|
|
||||||
195, # (2,3)
|
|
||||||
184,
|
|
||||||
182,
|
|
||||||
183, # (2,4)
|
|
||||||
37,
|
|
||||||
35,
|
|
||||||
36, # (3,0)
|
|
||||||
40,
|
|
||||||
38,
|
|
||||||
39, # (3,1)
|
|
||||||
43,
|
|
||||||
41,
|
|
||||||
42, # (3,2)
|
|
||||||
46,
|
|
||||||
44,
|
|
||||||
45, # (3,3)
|
|
||||||
34,
|
|
||||||
32,
|
|
||||||
33, # (3,4)
|
|
||||||
67,
|
|
||||||
65,
|
|
||||||
66, # (4,0)
|
|
||||||
70,
|
|
||||||
68,
|
|
||||||
69, # (4,1)
|
|
||||||
73,
|
|
||||||
71,
|
|
||||||
72, # (4,2)
|
|
||||||
76,
|
|
||||||
74,
|
|
||||||
75, # (4,3)
|
|
||||||
64,
|
|
||||||
62,
|
|
||||||
63, # (4,4)
|
|
||||||
97,
|
|
||||||
95,
|
|
||||||
96, # (5,0)
|
|
||||||
100,
|
|
||||||
98,
|
|
||||||
99, # (5,1)
|
|
||||||
103,
|
|
||||||
101,
|
|
||||||
102, # (5,2)
|
|
||||||
106,
|
|
||||||
104,
|
|
||||||
105, # (5,3)
|
|
||||||
94,
|
|
||||||
92,
|
|
||||||
93, # (5,4)
|
|
||||||
127,
|
|
||||||
125,
|
|
||||||
126, # (6,0) / right ring pixel 3
|
|
||||||
130,
|
|
||||||
128,
|
|
||||||
129, # (6,1)
|
|
||||||
133,
|
|
||||||
131,
|
|
||||||
132, # (6,2)
|
|
||||||
136,
|
|
||||||
134,
|
|
||||||
135, # (6,3)
|
|
||||||
124,
|
|
||||||
122,
|
|
||||||
123, # (6,4)
|
|
||||||
157,
|
|
||||||
155,
|
|
||||||
156, # (7,0)
|
|
||||||
160,
|
|
||||||
158,
|
|
||||||
159, # (7,1)
|
|
||||||
163,
|
|
||||||
161,
|
|
||||||
162, # (7,2) / right ring pixel 5
|
|
||||||
166,
|
|
||||||
164,
|
|
||||||
165, # (7,3) / 6
|
|
||||||
244,
|
|
||||||
242,
|
|
||||||
243, # (7,4) / 7
|
|
||||||
247,
|
|
||||||
245,
|
|
||||||
246, # (8,0)
|
|
||||||
250,
|
|
||||||
248,
|
|
||||||
249, # (8,1)
|
|
||||||
253,
|
|
||||||
251,
|
|
||||||
252, # (8,2)
|
|
||||||
256,
|
|
||||||
254,
|
|
||||||
255, # (8,3)
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (8,4) (clipped, nose bridge)
|
|
||||||
345,
|
|
||||||
347,
|
|
||||||
346, # (9,0)
|
|
||||||
342,
|
|
||||||
344,
|
|
||||||
343, # (9,1)
|
|
||||||
267,
|
|
||||||
269,
|
|
||||||
268, # (9,2)
|
|
||||||
263,
|
|
||||||
265,
|
|
||||||
264, # (9,3)
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (9,4) (clipped, nose bridge)
|
|
||||||
336,
|
|
||||||
338,
|
|
||||||
337, # (10,0)
|
|
||||||
333,
|
|
||||||
335,
|
|
||||||
334, # (10,1)
|
|
||||||
237,
|
|
||||||
239,
|
|
||||||
238, # (10,2) / left ring pixel 19
|
|
||||||
233,
|
|
||||||
235,
|
|
||||||
234, # (10,3) / 18
|
|
||||||
348,
|
|
||||||
262,
|
|
||||||
349, # (10,4) / 17
|
|
||||||
327,
|
|
||||||
329,
|
|
||||||
328, # (11,0) / left ring pixel 21
|
|
||||||
324,
|
|
||||||
326,
|
|
||||||
325, # (11,1)
|
|
||||||
207,
|
|
||||||
209,
|
|
||||||
208, # (11,2)
|
|
||||||
203,
|
|
||||||
205,
|
|
||||||
204, # (11,3)
|
|
||||||
330,
|
|
||||||
202,
|
|
||||||
331, # (11,4)
|
|
||||||
318,
|
|
||||||
320,
|
|
||||||
319, # (12,0)
|
|
||||||
315,
|
|
||||||
317,
|
|
||||||
316, # (12,1)
|
|
||||||
177,
|
|
||||||
179,
|
|
||||||
178, # (12,2)
|
|
||||||
173,
|
|
||||||
175,
|
|
||||||
174, # (12,3)
|
|
||||||
321,
|
|
||||||
172,
|
|
||||||
322, # (12,4)
|
|
||||||
309,
|
|
||||||
311,
|
|
||||||
310, # (13,0)
|
|
||||||
306,
|
|
||||||
308,
|
|
||||||
307, # (13,1)
|
|
||||||
147,
|
|
||||||
149,
|
|
||||||
148, # (13,2)
|
|
||||||
143,
|
|
||||||
145,
|
|
||||||
144, # (13,3)
|
|
||||||
312,
|
|
||||||
142,
|
|
||||||
313, # (13,4)
|
|
||||||
300,
|
|
||||||
302,
|
|
||||||
301, # (14,0)
|
|
||||||
297,
|
|
||||||
299,
|
|
||||||
298, # (14,1)
|
|
||||||
117,
|
|
||||||
119,
|
|
||||||
118, # (14,2)
|
|
||||||
113,
|
|
||||||
115,
|
|
||||||
114, # (14,3)
|
|
||||||
303,
|
|
||||||
112,
|
|
||||||
304, # (14,4)
|
|
||||||
291,
|
|
||||||
293,
|
|
||||||
292, # (15,0)
|
|
||||||
288,
|
|
||||||
290,
|
|
||||||
289, # (15,1)
|
|
||||||
87,
|
|
||||||
89,
|
|
||||||
88, # (15,2)
|
|
||||||
83,
|
|
||||||
85,
|
|
||||||
84, # (15,3)
|
|
||||||
294,
|
|
||||||
82,
|
|
||||||
295, # (15,4)
|
|
||||||
282,
|
|
||||||
284,
|
|
||||||
283, # (16,0) / left ring pixel 3
|
|
||||||
279,
|
|
||||||
281,
|
|
||||||
280, # (16,1)
|
|
||||||
57,
|
|
||||||
59,
|
|
||||||
58, # (16,2)
|
|
||||||
53,
|
|
||||||
55,
|
|
||||||
54, # (16,3)
|
|
||||||
285,
|
|
||||||
52,
|
|
||||||
286, # (16,4)
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (17,0) (clipped, corner)
|
|
||||||
270,
|
|
||||||
272,
|
|
||||||
271, # (17,1) / left ring pixel 4
|
|
||||||
27,
|
|
||||||
29,
|
|
||||||
28, # (17,2) / 5
|
|
||||||
23,
|
|
||||||
25,
|
|
||||||
24, # (17,3) / 6
|
|
||||||
276,
|
|
||||||
22,
|
|
||||||
277, # (17,4) / 7
|
|
||||||
)
|
|
||||||
|
|
||||||
# LED glasses 18 x 5 matrix but excluding LEDs shared with the eye rings
|
|
||||||
glassesmatrix_ledmap_no_ring = (
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (0,0) (clipped, corner)
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (0,1) / right ring pixel 20
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (0,2) / 19
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (0,3) / 18
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (0,4) / 17
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (1,0) / right ring pixel #21
|
|
||||||
220,
|
|
||||||
218,
|
|
||||||
219, # (1,1)
|
|
||||||
223,
|
|
||||||
221,
|
|
||||||
222, # (1,2)
|
|
||||||
226,
|
|
||||||
224,
|
|
||||||
225, # (1,3)
|
|
||||||
214,
|
|
||||||
212,
|
|
||||||
213, # (1,4)
|
|
||||||
187,
|
|
||||||
185,
|
|
||||||
186, # (2,0)
|
|
||||||
190,
|
|
||||||
188,
|
|
||||||
189, # (2,1)
|
|
||||||
193,
|
|
||||||
191,
|
|
||||||
192, # (2,2)
|
|
||||||
196,
|
|
||||||
194,
|
|
||||||
195, # (2,3)
|
|
||||||
184,
|
|
||||||
182,
|
|
||||||
183, # (2,4)
|
|
||||||
37,
|
|
||||||
35,
|
|
||||||
36, # (3,0)
|
|
||||||
40,
|
|
||||||
38,
|
|
||||||
39, # (3,1)
|
|
||||||
43,
|
|
||||||
41,
|
|
||||||
42, # (3,2)
|
|
||||||
46,
|
|
||||||
44,
|
|
||||||
45, # (3,3)
|
|
||||||
34,
|
|
||||||
32,
|
|
||||||
33, # (3,4)
|
|
||||||
67,
|
|
||||||
65,
|
|
||||||
66, # (4,0)
|
|
||||||
70,
|
|
||||||
68,
|
|
||||||
69, # (4,1)
|
|
||||||
73,
|
|
||||||
71,
|
|
||||||
72, # (4,2)
|
|
||||||
76,
|
|
||||||
74,
|
|
||||||
75, # (4,3)
|
|
||||||
64,
|
|
||||||
62,
|
|
||||||
63, # (4,4)
|
|
||||||
97,
|
|
||||||
95,
|
|
||||||
96, # (5,0)
|
|
||||||
100,
|
|
||||||
98,
|
|
||||||
99, # (5,1)
|
|
||||||
103,
|
|
||||||
101,
|
|
||||||
102, # (5,2)
|
|
||||||
106,
|
|
||||||
104,
|
|
||||||
105, # (5,3)
|
|
||||||
94,
|
|
||||||
92,
|
|
||||||
93, # (5,4)
|
|
||||||
127,
|
|
||||||
125,
|
|
||||||
126, # (6,0) / right ring pixel 3
|
|
||||||
130,
|
|
||||||
128,
|
|
||||||
129, # (6,1)
|
|
||||||
133,
|
|
||||||
131,
|
|
||||||
132, # (6,2)
|
|
||||||
136,
|
|
||||||
134,
|
|
||||||
135, # (6,3)
|
|
||||||
124,
|
|
||||||
122,
|
|
||||||
123, # (6,4)
|
|
||||||
157,
|
|
||||||
155,
|
|
||||||
156, # (7,0)
|
|
||||||
160,
|
|
||||||
158,
|
|
||||||
159, # (7,1)
|
|
||||||
163,
|
|
||||||
161,
|
|
||||||
162, # (7,2) / right ring pixel 5
|
|
||||||
166,
|
|
||||||
164,
|
|
||||||
165, # (7,3) / 6
|
|
||||||
244,
|
|
||||||
242,
|
|
||||||
243, # (7,4) / 7
|
|
||||||
247,
|
|
||||||
245,
|
|
||||||
246, # (8,0)
|
|
||||||
250,
|
|
||||||
248,
|
|
||||||
249, # (8,1)
|
|
||||||
253,
|
|
||||||
251,
|
|
||||||
252, # (8,2)
|
|
||||||
256,
|
|
||||||
254,
|
|
||||||
255, # (8,3)
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (8,4) (clipped, nose bridge)
|
|
||||||
345,
|
|
||||||
347,
|
|
||||||
346, # (9,0)
|
|
||||||
342,
|
|
||||||
344,
|
|
||||||
343, # (9,1)
|
|
||||||
267,
|
|
||||||
269,
|
|
||||||
268, # (9,2)
|
|
||||||
263,
|
|
||||||
265,
|
|
||||||
264, # (9,3)
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (9,4) (clipped, nose bridge)
|
|
||||||
336,
|
|
||||||
338,
|
|
||||||
337, # (10,0)
|
|
||||||
333,
|
|
||||||
335,
|
|
||||||
334, # (10,1)
|
|
||||||
237,
|
|
||||||
239,
|
|
||||||
238, # (10,2) / left ring pixel 19
|
|
||||||
233,
|
|
||||||
235,
|
|
||||||
234, # (10,3) / 18
|
|
||||||
348,
|
|
||||||
262,
|
|
||||||
349, # (10,4) / 17
|
|
||||||
327,
|
|
||||||
329,
|
|
||||||
328, # (11,0) / left ring pixel 21
|
|
||||||
324,
|
|
||||||
326,
|
|
||||||
325, # (11,1)
|
|
||||||
207,
|
|
||||||
209,
|
|
||||||
208, # (11,2)
|
|
||||||
203,
|
|
||||||
205,
|
|
||||||
204, # (11,3)
|
|
||||||
330,
|
|
||||||
202,
|
|
||||||
331, # (11,4)
|
|
||||||
318,
|
|
||||||
320,
|
|
||||||
319, # (12,0)
|
|
||||||
315,
|
|
||||||
317,
|
|
||||||
316, # (12,1)
|
|
||||||
177,
|
|
||||||
179,
|
|
||||||
178, # (12,2)
|
|
||||||
173,
|
|
||||||
175,
|
|
||||||
174, # (12,3)
|
|
||||||
321,
|
|
||||||
172,
|
|
||||||
322, # (12,4)
|
|
||||||
309,
|
|
||||||
311,
|
|
||||||
310, # (13,0)
|
|
||||||
306,
|
|
||||||
308,
|
|
||||||
307, # (13,1)
|
|
||||||
147,
|
|
||||||
149,
|
|
||||||
148, # (13,2)
|
|
||||||
143,
|
|
||||||
145,
|
|
||||||
144, # (13,3)
|
|
||||||
312,
|
|
||||||
142,
|
|
||||||
313, # (13,4)
|
|
||||||
300,
|
|
||||||
302,
|
|
||||||
301, # (14,0)
|
|
||||||
297,
|
|
||||||
299,
|
|
||||||
298, # (14,1)
|
|
||||||
117,
|
|
||||||
119,
|
|
||||||
118, # (14,2)
|
|
||||||
113,
|
|
||||||
115,
|
|
||||||
114, # (14,3)
|
|
||||||
303,
|
|
||||||
112,
|
|
||||||
304, # (14,4)
|
|
||||||
291,
|
|
||||||
293,
|
|
||||||
292, # (15,0)
|
|
||||||
288,
|
|
||||||
290,
|
|
||||||
289, # (15,1)
|
|
||||||
87,
|
|
||||||
89,
|
|
||||||
88, # (15,2)
|
|
||||||
83,
|
|
||||||
85,
|
|
||||||
84, # (15,3)
|
|
||||||
294,
|
|
||||||
82,
|
|
||||||
295, # (15,4)
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (16,0) / left ring pixel 3
|
|
||||||
279,
|
|
||||||
281,
|
|
||||||
280, # (16,1)
|
|
||||||
57,
|
|
||||||
59,
|
|
||||||
58, # (16,2)
|
|
||||||
53,
|
|
||||||
55,
|
|
||||||
54, # (16,3)
|
|
||||||
285,
|
|
||||||
52,
|
|
||||||
286, # (16,4)
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (17,0) (clipped, corner)
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (17,1) / left ring pixel 4
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (17,2) / 5
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (17,3) / 6
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # (17,4) / 7
|
|
||||||
)
|
|
||||||
|
|
||||||
# Left LED glasses eye ring
|
|
||||||
left_ring_map = (
|
|
||||||
341,
|
|
||||||
210,
|
|
||||||
211, # 0
|
|
||||||
332,
|
|
||||||
180,
|
|
||||||
181, # 1
|
|
||||||
323,
|
|
||||||
150,
|
|
||||||
151, # 2
|
|
||||||
127,
|
|
||||||
125,
|
|
||||||
126, # 3
|
|
||||||
154,
|
|
||||||
152,
|
|
||||||
153, # 4
|
|
||||||
163,
|
|
||||||
161,
|
|
||||||
162, # 5
|
|
||||||
166,
|
|
||||||
164,
|
|
||||||
165, # 6
|
|
||||||
244,
|
|
||||||
242,
|
|
||||||
243, # 7
|
|
||||||
259,
|
|
||||||
257,
|
|
||||||
258, # 8
|
|
||||||
169,
|
|
||||||
167,
|
|
||||||
168, # 9
|
|
||||||
139,
|
|
||||||
137,
|
|
||||||
138, # 10
|
|
||||||
109,
|
|
||||||
107,
|
|
||||||
108, # 11
|
|
||||||
79,
|
|
||||||
77,
|
|
||||||
78, # 12
|
|
||||||
49,
|
|
||||||
47,
|
|
||||||
48, # 13
|
|
||||||
199,
|
|
||||||
197,
|
|
||||||
198, # 14
|
|
||||||
229,
|
|
||||||
227,
|
|
||||||
228, # 15
|
|
||||||
19,
|
|
||||||
17,
|
|
||||||
18, # 16
|
|
||||||
4,
|
|
||||||
2,
|
|
||||||
3, # 17
|
|
||||||
16,
|
|
||||||
14,
|
|
||||||
15, # 18
|
|
||||||
13,
|
|
||||||
11,
|
|
||||||
12, # 19
|
|
||||||
10,
|
|
||||||
8,
|
|
||||||
9, # 20
|
|
||||||
217,
|
|
||||||
215,
|
|
||||||
216, # 21
|
|
||||||
7,
|
|
||||||
5,
|
|
||||||
6, # 22
|
|
||||||
350,
|
|
||||||
240,
|
|
||||||
241, # 23
|
|
||||||
)
|
|
||||||
|
|
||||||
# Left LED glasses eye ring excluding inner LEDs shared with the 18 x 5 matrix
|
|
||||||
left_ring_map_no_inner = (
|
|
||||||
341,
|
|
||||||
210,
|
|
||||||
211, # 0
|
|
||||||
332,
|
|
||||||
180,
|
|
||||||
181, # 1
|
|
||||||
323,
|
|
||||||
150,
|
|
||||||
151, # 2
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # 3
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # 4
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # 5
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # 6
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # 7
|
|
||||||
259,
|
|
||||||
257,
|
|
||||||
258, # 8
|
|
||||||
169,
|
|
||||||
167,
|
|
||||||
168, # 9
|
|
||||||
139,
|
|
||||||
137,
|
|
||||||
138, # 10
|
|
||||||
109,
|
|
||||||
107,
|
|
||||||
108, # 11
|
|
||||||
79,
|
|
||||||
77,
|
|
||||||
78, # 12
|
|
||||||
49,
|
|
||||||
47,
|
|
||||||
48, # 13
|
|
||||||
199,
|
|
||||||
197,
|
|
||||||
198, # 14
|
|
||||||
229,
|
|
||||||
227,
|
|
||||||
228, # 15
|
|
||||||
19,
|
|
||||||
17,
|
|
||||||
18, # 16
|
|
||||||
4,
|
|
||||||
2,
|
|
||||||
3, # 17
|
|
||||||
16,
|
|
||||||
14,
|
|
||||||
15, # 18
|
|
||||||
13,
|
|
||||||
11,
|
|
||||||
12, # 19
|
|
||||||
10,
|
|
||||||
8,
|
|
||||||
9, # 20
|
|
||||||
217,
|
|
||||||
215,
|
|
||||||
216, # 21
|
|
||||||
7,
|
|
||||||
5,
|
|
||||||
6, # 22
|
|
||||||
350,
|
|
||||||
240,
|
|
||||||
241, # 23
|
|
||||||
)
|
|
||||||
|
|
||||||
# Right LED glasses eye ring
|
|
||||||
right_ring_map = (
|
|
||||||
287,
|
|
||||||
30,
|
|
||||||
31, # 0
|
|
||||||
278,
|
|
||||||
0,
|
|
||||||
1, # 1
|
|
||||||
273,
|
|
||||||
275,
|
|
||||||
274, # 2
|
|
||||||
282,
|
|
||||||
284,
|
|
||||||
283, # 3
|
|
||||||
270,
|
|
||||||
272,
|
|
||||||
271, # 4
|
|
||||||
27,
|
|
||||||
29,
|
|
||||||
28, # 5
|
|
||||||
23,
|
|
||||||
25,
|
|
||||||
24, # 6
|
|
||||||
276,
|
|
||||||
22,
|
|
||||||
277, # 7
|
|
||||||
20,
|
|
||||||
26,
|
|
||||||
21, # 8
|
|
||||||
50,
|
|
||||||
56,
|
|
||||||
51, # 9
|
|
||||||
80,
|
|
||||||
86,
|
|
||||||
81, # 10
|
|
||||||
110,
|
|
||||||
116,
|
|
||||||
111, # 11
|
|
||||||
140,
|
|
||||||
146,
|
|
||||||
141, # 12
|
|
||||||
170,
|
|
||||||
176,
|
|
||||||
171, # 13
|
|
||||||
200,
|
|
||||||
206,
|
|
||||||
201, # 14
|
|
||||||
230,
|
|
||||||
236,
|
|
||||||
231, # 15
|
|
||||||
260,
|
|
||||||
266,
|
|
||||||
261, # 16
|
|
||||||
348,
|
|
||||||
262,
|
|
||||||
349, # 17
|
|
||||||
233,
|
|
||||||
235,
|
|
||||||
234, # 18
|
|
||||||
237,
|
|
||||||
239,
|
|
||||||
238, # 19
|
|
||||||
339,
|
|
||||||
232,
|
|
||||||
340, # 20
|
|
||||||
327,
|
|
||||||
329,
|
|
||||||
328, # 21
|
|
||||||
305,
|
|
||||||
90,
|
|
||||||
91, # 22
|
|
||||||
296,
|
|
||||||
60,
|
|
||||||
61, # 23
|
|
||||||
)
|
|
||||||
|
|
||||||
# Right LED glasses eye ring excluding inner LEDs shared with the 18 x 5 matrix
|
|
||||||
right_ring_map_no_inner = (
|
|
||||||
287,
|
|
||||||
30,
|
|
||||||
31, # 0
|
|
||||||
278,
|
|
||||||
0,
|
|
||||||
1, # 1
|
|
||||||
273,
|
|
||||||
275,
|
|
||||||
274, # 2
|
|
||||||
282,
|
|
||||||
284,
|
|
||||||
283, # 3
|
|
||||||
270,
|
|
||||||
272,
|
|
||||||
271, # 4
|
|
||||||
27,
|
|
||||||
29,
|
|
||||||
28, # 5
|
|
||||||
23,
|
|
||||||
25,
|
|
||||||
24, # 6
|
|
||||||
276,
|
|
||||||
22,
|
|
||||||
277, # 7
|
|
||||||
20,
|
|
||||||
26,
|
|
||||||
21, # 8
|
|
||||||
50,
|
|
||||||
56,
|
|
||||||
51, # 9
|
|
||||||
80,
|
|
||||||
86,
|
|
||||||
81, # 10
|
|
||||||
110,
|
|
||||||
116,
|
|
||||||
111, # 11
|
|
||||||
140,
|
|
||||||
146,
|
|
||||||
141, # 12
|
|
||||||
170,
|
|
||||||
176,
|
|
||||||
171, # 13
|
|
||||||
200,
|
|
||||||
206,
|
|
||||||
201, # 14
|
|
||||||
230,
|
|
||||||
236,
|
|
||||||
231, # 15
|
|
||||||
260,
|
|
||||||
266,
|
|
||||||
261, # 16
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # 17
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # 18
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # 19
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # 20
|
|
||||||
65535,
|
|
||||||
65535,
|
|
||||||
65535, # 21
|
|
||||||
305,
|
|
||||||
90,
|
|
||||||
91, # 22
|
|
||||||
296,
|
|
||||||
60,
|
|
||||||
61, # 23
|
|
||||||
)
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
|
|
||||||
.. If you created a package, create one automodule per module in the package.
|
.. If you created a package, create one automodule per module in the package.
|
||||||
|
|
||||||
API Reference
|
|
||||||
#############
|
|
||||||
|
|
||||||
.. automodule:: adafruit_is31fl3741
|
.. automodule:: adafruit_is31fl3741
|
||||||
:members:
|
:members:
|
||||||
|
|
|
||||||
33
docs/conf.py
33
docs/conf.py
|
|
@ -1,8 +1,9 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
|
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import datetime
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
@ -15,7 +16,6 @@ sys.path.insert(0, os.path.abspath(".."))
|
||||||
# ones.
|
# ones.
|
||||||
extensions = [
|
extensions = [
|
||||||
"sphinx.ext.autodoc",
|
"sphinx.ext.autodoc",
|
||||||
"sphinxcontrib.jquery",
|
|
||||||
"sphinx.ext.intersphinx",
|
"sphinx.ext.intersphinx",
|
||||||
"sphinx.ext.viewcode",
|
"sphinx.ext.viewcode",
|
||||||
]
|
]
|
||||||
|
|
@ -26,12 +26,12 @@ extensions = [
|
||||||
autodoc_mock_imports = ["adafruit_bus_device", "adafruit_register"]
|
autodoc_mock_imports = ["adafruit_bus_device", "adafruit_register"]
|
||||||
|
|
||||||
intersphinx_mapping = {
|
intersphinx_mapping = {
|
||||||
"python": ("https://docs.python.org/3", None),
|
"python": ("https://docs.python.org/3.4", None),
|
||||||
"BusDevice": (
|
"BusDevice": (
|
||||||
"https://docs.circuitpython.org/projects/busdevice/en/latest/",
|
"https://circuitpython.readthedocs.io/projects/busdevice/en/latest/",
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
|
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
|
|
@ -44,12 +44,7 @@ master_doc = "index"
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = "Adafruit IS31FL3741 Library"
|
project = "Adafruit IS31FL3741 Library"
|
||||||
creation_year = "2021"
|
copyright = "2021 Ladyada"
|
||||||
current_year = str(datetime.datetime.now().year)
|
|
||||||
year_duration = (
|
|
||||||
current_year if current_year == creation_year else creation_year + " - " + current_year
|
|
||||||
)
|
|
||||||
copyright = year_duration + " Ladyada"
|
|
||||||
author = "Ladyada"
|
author = "Ladyada"
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
|
|
@ -66,7 +61,7 @@ release = "1.0"
|
||||||
#
|
#
|
||||||
# This is also used if you do content translation via gettext catalogs.
|
# This is also used if you do content translation via gettext catalogs.
|
||||||
# Usually you set "language" from the command line for these cases.
|
# Usually you set "language" from the command line for these cases.
|
||||||
language = "en"
|
language = None
|
||||||
|
|
||||||
# List of patterns, relative to source directory, that match files and
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
|
|
@ -97,9 +92,19 @@ todo_emit_warnings = True
|
||||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
# a list of builtin themes.
|
# a list of builtin themes.
|
||||||
#
|
#
|
||||||
import sphinx_rtd_theme
|
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
|
||||||
|
|
||||||
html_theme = "sphinx_rtd_theme"
|
if not on_rtd: # only import and set the theme if we're building docs locally
|
||||||
|
try:
|
||||||
|
import sphinx_rtd_theme
|
||||||
|
|
||||||
|
html_theme = "sphinx_rtd_theme"
|
||||||
|
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
|
||||||
|
except:
|
||||||
|
html_theme = "default"
|
||||||
|
html_theme_path = ["."]
|
||||||
|
else:
|
||||||
|
html_theme_path = ["."]
|
||||||
|
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,8 @@ Table of Contents
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:caption: Other Links
|
:caption: Other Links
|
||||||
|
|
||||||
Download from GitHub <https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3741/releases/latest>
|
Download <https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3741/releases/latest>
|
||||||
Download Library Bundle <https://circuitpython.org/libraries>
|
CircuitPython Reference Documentation <https://circuitpython.readthedocs.io>
|
||||||
CircuitPython Reference Documentation <https://docs.circuitpython.org>
|
|
||||||
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60>
|
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60>
|
||||||
Discord Chat <https://adafru.it/discord>
|
Discord Chat <https://adafru.it/discord>
|
||||||
Adafruit Learning System <https://learn.adafruit.com>
|
Adafruit Learning System <https://learn.adafruit.com>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,4 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Unlicense
|
# SPDX-License-Identifier: Unlicense
|
||||||
|
|
||||||
sphinx
|
sphinx>=4.0.0
|
||||||
sphinxcontrib-jquery
|
|
||||||
sphinx-rtd-theme
|
|
||||||
|
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2023 DJDevon3
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
# Chaining 4 13x9 Matrix's to run sequentially (not simultaneously)
|
|
||||||
|
|
||||||
import board
|
|
||||||
from adafruit_led_animation.animation.rainbowchase import RainbowChase
|
|
||||||
from adafruit_led_animation.sequence import AnimationSequence
|
|
||||||
|
|
||||||
from adafruit_is31fl3741 import PREFER_BUFFER
|
|
||||||
from adafruit_is31fl3741.adafruit_rgbmatrixqt import Adafruit_RGBMatrixQT
|
|
||||||
from adafruit_is31fl3741.is31fl3741_pixelbuf import IS31FL3741_PixelBuf
|
|
||||||
|
|
||||||
# Initialize I2C Bus
|
|
||||||
i2c = board.STEMMA_I2C()
|
|
||||||
# i2c = board.I2C() # uses board.SCL and board.SDA
|
|
||||||
|
|
||||||
# Initialize each 13x9 Matrix
|
|
||||||
Matrix30 = Adafruit_RGBMatrixQT(i2c, address=0x30, allocate=PREFER_BUFFER)
|
|
||||||
Matrix30.set_led_scaling(0xFF)
|
|
||||||
Matrix30.global_current = 0x01
|
|
||||||
Matrix30.enable = True
|
|
||||||
|
|
||||||
Matrix31 = Adafruit_RGBMatrixQT(i2c, address=0x31, allocate=PREFER_BUFFER)
|
|
||||||
Matrix31.set_led_scaling(0xFF)
|
|
||||||
Matrix31.global_current = 0x01
|
|
||||||
Matrix31.enable = True
|
|
||||||
|
|
||||||
Matrix32 = Adafruit_RGBMatrixQT(i2c, address=0x32, allocate=PREFER_BUFFER)
|
|
||||||
Matrix32.set_led_scaling(0xFF)
|
|
||||||
Matrix32.global_current = 0x01
|
|
||||||
Matrix32.enable = True
|
|
||||||
|
|
||||||
Matrix33 = Adafruit_RGBMatrixQT(i2c, address=0x33, allocate=PREFER_BUFFER)
|
|
||||||
Matrix33.set_led_scaling(0xFF)
|
|
||||||
Matrix33.global_current = 0x01
|
|
||||||
Matrix33.enable = True
|
|
||||||
|
|
||||||
# Demo scrolling pixels
|
|
||||||
WIDTH = 13
|
|
||||||
HEIGHT = 9
|
|
||||||
LEDS_MAP = tuple(
|
|
||||||
address
|
|
||||||
for y in range(HEIGHT)
|
|
||||||
for x in range(WIDTH)
|
|
||||||
for address in Adafruit_RGBMatrixQT.pixel_addrs(x, y)
|
|
||||||
)
|
|
||||||
Matrix30_pixels = IS31FL3741_PixelBuf(Matrix30, LEDS_MAP, init=False, auto_write=False)
|
|
||||||
Matrix30_chase = RainbowChase(Matrix30_pixels, speed=0.1, size=1, spacing=3, step=8)
|
|
||||||
|
|
||||||
Matrix31_pixels = IS31FL3741_PixelBuf(Matrix31, LEDS_MAP, init=False, auto_write=False)
|
|
||||||
Matrix31_chase = RainbowChase(Matrix31_pixels, speed=0.1, size=1, spacing=3, step=8)
|
|
||||||
|
|
||||||
Matrix32_pixels = IS31FL3741_PixelBuf(Matrix32, LEDS_MAP, init=False, auto_write=False)
|
|
||||||
Matrix32_chase = RainbowChase(Matrix32_pixels, speed=0.1, size=1, spacing=3, step=8)
|
|
||||||
|
|
||||||
Matrix33_pixels = IS31FL3741_PixelBuf(Matrix33, LEDS_MAP, init=False, auto_write=False)
|
|
||||||
Matrix33_chase = RainbowChase(Matrix33_pixels, speed=0.1, size=1, spacing=3, step=8)
|
|
||||||
|
|
||||||
# Run animation on each 13x9 matrix sequentially
|
|
||||||
animations = AnimationSequence(
|
|
||||||
Matrix30_chase,
|
|
||||||
Matrix31_chase,
|
|
||||||
Matrix32_chase,
|
|
||||||
Matrix33_chase,
|
|
||||||
advance_interval=1,
|
|
||||||
auto_clear=False,
|
|
||||||
)
|
|
||||||
while True:
|
|
||||||
animations.animate()
|
|
||||||
|
|
@ -11,9 +11,7 @@ from adafruit_led_animation.sequence import AnimationSequence
|
||||||
from adafruit_is31fl3741.adafruit_ledglasses import MUST_BUFFER, LED_Glasses
|
from adafruit_is31fl3741.adafruit_ledglasses import MUST_BUFFER, LED_Glasses
|
||||||
from adafruit_is31fl3741.led_glasses_animation import LED_Glasses_Animation
|
from adafruit_is31fl3741.led_glasses_animation import LED_Glasses_Animation
|
||||||
|
|
||||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
glasses = LED_Glasses(board.I2C(), allocate=MUST_BUFFER)
|
||||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
|
||||||
glasses = LED_Glasses(i2c, allocate=MUST_BUFFER)
|
|
||||||
glasses.set_led_scaling(255)
|
glasses.set_led_scaling(255)
|
||||||
glasses.global_current = 0xFE
|
glasses.global_current = 0xFE
|
||||||
glasses.enable = True
|
glasses.enable = True
|
||||||
|
|
@ -23,6 +21,8 @@ pixels = LED_Glasses_Animation(glasses)
|
||||||
anim1 = RainbowComet(pixels, 0.05, tail_length=24, ring=True)
|
anim1 = RainbowComet(pixels, 0.05, tail_length=24, ring=True)
|
||||||
anim2 = Sparkle(pixels, 0.05, PURPLE)
|
anim2 = Sparkle(pixels, 0.05, PURPLE)
|
||||||
anim3 = ColorCycle(pixels, 0.03)
|
anim3 = ColorCycle(pixels, 0.03)
|
||||||
group = AnimationSequence(anim1, anim2, anim3, advance_interval=4, auto_reset=True, auto_clear=True)
|
group = AnimationSequence(
|
||||||
|
anim1, anim2, anim3, advance_interval=4, auto_reset=True, auto_clear=True
|
||||||
|
)
|
||||||
while True:
|
while True:
|
||||||
group.animate()
|
group.animate()
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,10 @@
|
||||||
|
|
||||||
import board
|
import board
|
||||||
from rainbowio import colorwheel
|
from rainbowio import colorwheel
|
||||||
|
|
||||||
import adafruit_is31fl3741
|
|
||||||
from adafruit_is31fl3741.adafruit_ledglasses import LED_Glasses
|
from adafruit_is31fl3741.adafruit_ledglasses import LED_Glasses
|
||||||
|
import adafruit_is31fl3741
|
||||||
|
|
||||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
glasses = LED_Glasses(board.I2C(), allocate=adafruit_is31fl3741.MUST_BUFFER)
|
||||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
|
||||||
glasses = LED_Glasses(i2c, allocate=adafruit_is31fl3741.MUST_BUFFER)
|
|
||||||
|
|
||||||
wheeloffset = 0
|
wheeloffset = 0
|
||||||
while True:
|
while True:
|
||||||
|
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2021 Mark Komus
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
# Currently example only compatible with Adafruit LED Glasses Driver nRF52840
|
|
||||||
import board
|
|
||||||
import busio
|
|
||||||
import displayio
|
|
||||||
import framebufferio
|
|
||||||
import is31fl3741
|
|
||||||
from adafruit_bitmap_font import bitmap_font
|
|
||||||
from adafruit_display_text import label
|
|
||||||
from adafruit_led_animation.animation.chase import Chase
|
|
||||||
from adafruit_led_animation.animation.comet import Comet
|
|
||||||
|
|
||||||
from adafruit_is31fl3741.is31fl3741_PixelBuf import IS31FL3741_PixelBuf
|
|
||||||
from adafruit_is31fl3741.led_glasses_map import (
|
|
||||||
glassesmatrix_ledmap_no_ring,
|
|
||||||
left_ring_map_no_inner,
|
|
||||||
right_ring_map_no_inner,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Release any existing displays
|
|
||||||
displayio.release_displays()
|
|
||||||
|
|
||||||
# Create our own I2C bus with a 1Mhz frequency for faster updates
|
|
||||||
i2c = busio.I2C(board.SCL, board.SDA, frequency=1000000)
|
|
||||||
|
|
||||||
# Initalize the IS31FL3741
|
|
||||||
is31 = is31fl3741.IS31FL3741(i2c=i2c)
|
|
||||||
|
|
||||||
# Initialize the IS31FL3741 displayio display
|
|
||||||
is31_fb = is31fl3741.IS31FL3741_FrameBuffer(
|
|
||||||
width=54,
|
|
||||||
height=15,
|
|
||||||
is31=is31,
|
|
||||||
scale=True,
|
|
||||||
gamma=True,
|
|
||||||
mapping=glassesmatrix_ledmap_no_ring,
|
|
||||||
)
|
|
||||||
display = framebufferio.FramebufferDisplay(is31_fb, auto_refresh=True)
|
|
||||||
|
|
||||||
# Turn the brightness down
|
|
||||||
is31_fb.brightness = 0.1
|
|
||||||
|
|
||||||
# Create pixel buffers for each eye. Init is False as the display setup initialized the chip
|
|
||||||
eye_left = IS31FL3741_PixelBuf(is31, left_ring_map_no_inner, init=False, auto_write=False)
|
|
||||||
eye_right = IS31FL3741_PixelBuf(is31, right_ring_map_no_inner, init=False, auto_write=False)
|
|
||||||
|
|
||||||
# Create a different animation for each eye ring
|
|
||||||
chase = Chase(eye_left, speed=0.05, color=(0, 0, 150), size=8, spacing=4)
|
|
||||||
comet = Comet(eye_right, speed=0.01, color=(0, 0, 150), tail_length=10, bounce=False)
|
|
||||||
|
|
||||||
# Create text to scroll across the display
|
|
||||||
font = bitmap_font.load_font("scrolly.bdf")
|
|
||||||
text = "HELLO FROM CIRCUITPYTHON ON NATIVE DISPLAYIO"
|
|
||||||
color = (255, 210, 0)
|
|
||||||
text_area = label.Label(font, text=text, color=color)
|
|
||||||
|
|
||||||
# Set the text location
|
|
||||||
text_width = text_area.bounding_box[2]
|
|
||||||
text_area.x = display.width
|
|
||||||
text_area.y = 8
|
|
||||||
|
|
||||||
# Add the text label to the display
|
|
||||||
group = displayio.Group()
|
|
||||||
group.append(text_area)
|
|
||||||
display.root_group = group
|
|
||||||
|
|
||||||
# Scroll the text and update the animations
|
|
||||||
x = display.width
|
|
||||||
while True:
|
|
||||||
x = x - 1
|
|
||||||
text_area.x = x
|
|
||||||
if x == -text_width:
|
|
||||||
x = display.width
|
|
||||||
|
|
||||||
chase.animate()
|
|
||||||
comet.animate()
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
|
|
||||||
# SPDX-FileCopyrightText: 2023 Neradoc https://neradoc.me
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
"""
|
|
||||||
This example repeatedly displays all available animations
|
|
||||||
on the IS31FL3741 13x9 RGB Matrix, at a five second interval.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import board
|
|
||||||
from adafruit_led_animation.animation.blink import Blink
|
|
||||||
from adafruit_led_animation.animation.chase import Chase
|
|
||||||
from adafruit_led_animation.animation.colorcycle import ColorCycle
|
|
||||||
from adafruit_led_animation.animation.comet import Comet
|
|
||||||
from adafruit_led_animation.animation.customcolorchase import CustomColorChase
|
|
||||||
from adafruit_led_animation.animation.pulse import Pulse
|
|
||||||
from adafruit_led_animation.animation.rainbow import Rainbow
|
|
||||||
from adafruit_led_animation.animation.rainbowchase import RainbowChase
|
|
||||||
from adafruit_led_animation.animation.rainbowcomet import RainbowComet
|
|
||||||
from adafruit_led_animation.animation.rainbowsparkle import RainbowSparkle
|
|
||||||
from adafruit_led_animation.animation.solid import Solid
|
|
||||||
from adafruit_led_animation.animation.sparkle import Sparkle
|
|
||||||
from adafruit_led_animation.animation.sparklepulse import SparklePulse
|
|
||||||
from adafruit_led_animation.color import AMBER, JADE, MAGENTA, ORANGE, PURPLE, WHITE
|
|
||||||
from adafruit_led_animation.sequence import AnimationSequence
|
|
||||||
|
|
||||||
from adafruit_is31fl3741 import PREFER_BUFFER
|
|
||||||
from adafruit_is31fl3741.adafruit_rgbmatrixqt import Adafruit_RGBMatrixQT
|
|
||||||
from adafruit_is31fl3741.is31fl3741_pixelbuf import IS31FL3741_PixelBuf
|
|
||||||
|
|
||||||
# i2c = board.I2C()
|
|
||||||
i2c = board.STEMMA_I2C()
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Instantiate the nice IS31FL3741
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
is31 = Adafruit_RGBMatrixQT(i2c, allocate=PREFER_BUFFER)
|
|
||||||
is31.set_led_scaling(0xFF)
|
|
||||||
is31.global_current = 0xFF
|
|
||||||
is31.enable = True
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Setup the mapping and PixelBuf instance
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
WIDTH = 13
|
|
||||||
HEIGHT = 9
|
|
||||||
LEDS_MAP = tuple(
|
|
||||||
address
|
|
||||||
for y in range(HEIGHT)
|
|
||||||
for x in range(WIDTH)
|
|
||||||
for address in Adafruit_RGBMatrixQT.pixel_addrs(x, y)
|
|
||||||
)
|
|
||||||
pixels = IS31FL3741_PixelBuf(is31, LEDS_MAP, init=False, auto_write=False)
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Run animations
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
blink = Blink(pixels, speed=0.5, color=JADE)
|
|
||||||
colorcycle = ColorCycle(pixels, speed=0.4, colors=[MAGENTA, ORANGE])
|
|
||||||
comet = Comet(pixels, speed=0.01, color=PURPLE, tail_length=10, bounce=True)
|
|
||||||
chase = Chase(pixels, speed=0.1, size=3, spacing=6, color=WHITE)
|
|
||||||
pulse = Pulse(pixels, speed=0.1, period=3, color=AMBER)
|
|
||||||
sparkle = Sparkle(pixels, speed=0.1, color=PURPLE, num_sparkles=10)
|
|
||||||
solid = Solid(pixels, color=JADE)
|
|
||||||
rainbow = Rainbow(pixels, speed=0.1, period=2)
|
|
||||||
sparkle_pulse = SparklePulse(pixels, speed=0.1, period=3, color=JADE)
|
|
||||||
rainbow_comet = RainbowComet(pixels, speed=0.1, tail_length=7, bounce=True)
|
|
||||||
rainbow_chase = RainbowChase(pixels, speed=0.1, size=3, spacing=2, step=8)
|
|
||||||
rainbow_sparkle = RainbowSparkle(pixels, speed=0.1, num_sparkles=15)
|
|
||||||
custom_color_chase = CustomColorChase(
|
|
||||||
pixels, speed=0.1, size=2, spacing=3, colors=[ORANGE, WHITE, JADE]
|
|
||||||
)
|
|
||||||
|
|
||||||
animations = AnimationSequence(
|
|
||||||
comet,
|
|
||||||
blink,
|
|
||||||
rainbow_sparkle,
|
|
||||||
chase,
|
|
||||||
pulse,
|
|
||||||
sparkle,
|
|
||||||
rainbow,
|
|
||||||
solid,
|
|
||||||
rainbow_comet,
|
|
||||||
sparkle_pulse,
|
|
||||||
rainbow_chase,
|
|
||||||
custom_color_chase,
|
|
||||||
advance_interval=5,
|
|
||||||
auto_clear=True,
|
|
||||||
)
|
|
||||||
while True:
|
|
||||||
animations.animate()
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
|
|
||||||
# SPDX-FileCopyrightText: 2023 Neradoc https://neradoc.me
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
"""
|
|
||||||
This example repeatedly displays all available animations
|
|
||||||
on the IS31FL3741 13x9 RGB Matrix, at a five second interval.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import board
|
|
||||||
from adafruit_led_animation.animation.blink import Blink
|
|
||||||
from adafruit_led_animation.animation.colorcycle import ColorCycle
|
|
||||||
from adafruit_led_animation.animation.comet import Comet
|
|
||||||
from adafruit_led_animation.color import JADE, PURPLE
|
|
||||||
from adafruit_led_animation.sequence import AnimationSequence
|
|
||||||
|
|
||||||
from adafruit_is31fl3741 import PREFER_BUFFER
|
|
||||||
from adafruit_is31fl3741.adafruit_rgbmatrixqt import Adafruit_RGBMatrixQT
|
|
||||||
from adafruit_is31fl3741.is31fl3741_pixelbuf import IS31FL3741_PixelBuf
|
|
||||||
|
|
||||||
# i2c = board.I2C()
|
|
||||||
i2c = board.STEMMA_I2C()
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Instantiate the nice IS31FL3741
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
is31 = Adafruit_RGBMatrixQT(i2c, allocate=PREFER_BUFFER)
|
|
||||||
is31.set_led_scaling(0xFF)
|
|
||||||
is31.global_current = 0xFF
|
|
||||||
is31.enable = True
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Setup the mapping and PixelBuf instance
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
WIDTH = 13
|
|
||||||
HEIGHT = 9
|
|
||||||
LEDS_MAP = tuple(
|
|
||||||
address
|
|
||||||
for y in range(HEIGHT)
|
|
||||||
for x in range(WIDTH)
|
|
||||||
for address in Adafruit_RGBMatrixQT.pixel_addrs(x, y)
|
|
||||||
)
|
|
||||||
pixels = IS31FL3741_PixelBuf(is31, LEDS_MAP, init=False, auto_write=False)
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Run animations
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
blink = Blink(pixels, speed=0.5, color=JADE)
|
|
||||||
colorcycle = ColorCycle(pixels, speed=0.4)
|
|
||||||
comet = Comet(pixels, speed=0.01, color=PURPLE, tail_length=10, bounce=True)
|
|
||||||
|
|
||||||
|
|
||||||
animations = AnimationSequence(
|
|
||||||
blink,
|
|
||||||
comet,
|
|
||||||
colorcycle,
|
|
||||||
advance_interval=5,
|
|
||||||
auto_clear=True,
|
|
||||||
)
|
|
||||||
while True:
|
|
||||||
animations.animate()
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
|
|
||||||
# SPDX-FileCopyrightText: 2023 Neradoc https://neradoc.me
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
"""
|
|
||||||
This example repeatedly displays all available animations
|
|
||||||
on the IS31FL3741 13x9 RGB Matrix, at a five second interval.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import board
|
|
||||||
from adafruit_led_animation.animation.blink import Blink
|
|
||||||
from adafruit_led_animation.color import PINK
|
|
||||||
|
|
||||||
from adafruit_is31fl3741 import PREFER_BUFFER
|
|
||||||
from adafruit_is31fl3741.adafruit_rgbmatrixqt import Adafruit_RGBMatrixQT
|
|
||||||
from adafruit_is31fl3741.is31fl3741_pixelbuf import IS31FL3741_PixelBuf
|
|
||||||
|
|
||||||
# i2c = board.I2C()
|
|
||||||
i2c = board.STEMMA_I2C()
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Instantiate the nice IS31FL3741
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
is31 = Adafruit_RGBMatrixQT(i2c, allocate=PREFER_BUFFER)
|
|
||||||
is31.set_led_scaling(0xFF)
|
|
||||||
is31.global_current = 0xFF
|
|
||||||
is31.enable = True
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Setup the mapping and PixelBuf instance
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
WIDTH = 13
|
|
||||||
HEIGHT = 9
|
|
||||||
LEDS_MAP = tuple(
|
|
||||||
address
|
|
||||||
for y in range(HEIGHT)
|
|
||||||
for x in range(WIDTH)
|
|
||||||
for address in Adafruit_RGBMatrixQT.pixel_addrs(x, y)
|
|
||||||
)
|
|
||||||
pixels = IS31FL3741_PixelBuf(is31, LEDS_MAP, init=False, auto_write=False)
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Run animations
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
blink = Blink(pixels, speed=0.5, color=PINK)
|
|
||||||
|
|
||||||
while True:
|
|
||||||
blink.animate()
|
|
||||||
|
|
@ -4,12 +4,10 @@
|
||||||
import board
|
import board
|
||||||
from rainbowio import colorwheel
|
from rainbowio import colorwheel
|
||||||
|
|
||||||
import adafruit_is31fl3741
|
|
||||||
from adafruit_is31fl3741.adafruit_rgbmatrixqt import Adafruit_RGBMatrixQT
|
from adafruit_is31fl3741.adafruit_rgbmatrixqt import Adafruit_RGBMatrixQT
|
||||||
|
import adafruit_is31fl3741
|
||||||
|
|
||||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
is31 = Adafruit_RGBMatrixQT(board.I2C(), allocate=adafruit_is31fl3741.PREFER_BUFFER)
|
||||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
|
||||||
is31 = Adafruit_RGBMatrixQT(i2c, allocate=adafruit_is31fl3741.PREFER_BUFFER)
|
|
||||||
is31.set_led_scaling(0xFF)
|
is31.set_led_scaling(0xFF)
|
||||||
is31.global_current = 0xFF
|
is31.global_current = 0xFF
|
||||||
# print("Global current is: ", is31.global_current)
|
# print("Global current is: ", is31.global_current)
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,10 @@
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import board
|
import board
|
||||||
|
|
||||||
import adafruit_is31fl3741
|
import adafruit_is31fl3741
|
||||||
|
|
||||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
is31 = adafruit_is31fl3741.IS31FL3741(board.I2C())
|
||||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
|
||||||
is31 = adafruit_is31fl3741.IS31FL3741(i2c)
|
|
||||||
|
|
||||||
is31.set_led_scaling(0xFF) # turn on LEDs all the way
|
is31.set_led_scaling(0xFF) # turn on LEDs all the way
|
||||||
is31.global_current = 0xFF # set current to max
|
is31.global_current = 0xFF # set current to max
|
||||||
|
|
|
||||||
1212
examples/scrolly.bdf
1212
examples/scrolly.bdf
File diff suppressed because it is too large
Load diff
|
|
@ -1,2 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2022 Mark Komus
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Unlicense
|
|
||||||
|
|
||||||
pillow
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2022 Alec Delaney for Adafruit Industries
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
[build-system]
|
|
||||||
requires = [
|
|
||||||
"setuptools",
|
|
||||||
"wheel",
|
|
||||||
"setuptools-scm",
|
|
||||||
]
|
|
||||||
|
|
||||||
[project]
|
|
||||||
name = "adafruit-circuitpython-is31fl3741"
|
|
||||||
description = "CircuitPython library for IS31FL3741 RGB LED matrices."
|
|
||||||
version = "0.0.0+auto.0"
|
|
||||||
readme = "README.rst"
|
|
||||||
authors = [
|
|
||||||
{name = "Adafruit Industries", email = "circuitpython@adafruit.com"}
|
|
||||||
]
|
|
||||||
urls = {Homepage = "https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3741"}
|
|
||||||
keywords = [
|
|
||||||
"adafruit",
|
|
||||||
"is31fl3741",
|
|
||||||
"led",
|
|
||||||
"matrix",
|
|
||||||
"charlieplex",
|
|
||||||
"featherwingbreakout",
|
|
||||||
"hardware",
|
|
||||||
"micropython",
|
|
||||||
"circuitpython",
|
|
||||||
]
|
|
||||||
license = {text = "MIT"}
|
|
||||||
classifiers = [
|
|
||||||
"Intended Audience :: Developers",
|
|
||||||
"Topic :: Software Development :: Libraries",
|
|
||||||
"Topic :: Software Development :: Embedded Systems",
|
|
||||||
"Topic :: System :: Hardware",
|
|
||||||
"License :: OSI Approved :: MIT License",
|
|
||||||
"Programming Language :: Python :: 3",
|
|
||||||
]
|
|
||||||
dynamic = ["dependencies", "optional-dependencies"]
|
|
||||||
|
|
||||||
[tool.setuptools]
|
|
||||||
packages = ["adafruit_is31fl3741"]
|
|
||||||
|
|
||||||
[tool.setuptools.dynamic]
|
|
||||||
dependencies = {file = ["requirements.txt"]}
|
|
||||||
optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries
|
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Unlicense
|
# SPDX-License-Identifier: Unlicense
|
||||||
|
|
||||||
Adafruit-Blinka
|
Adafruit-Blinka
|
||||||
adafruit-circuitpython-framebuf
|
adafruit-circuitpython-framebuf
|
||||||
adafruit-circuitpython-busdevice
|
|
||||||
adafruit-circuitpython-typing~=1.6
|
|
||||||
adafruit-circuitpython-register
|
adafruit-circuitpython-register
|
||||||
|
Pillow
|
||||||
|
|
|
||||||
105
ruff.toml
105
ruff.toml
|
|
@ -1,105 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2024 Tim Cocks for Adafruit Industries
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
target-version = "py38"
|
|
||||||
line-length = 100
|
|
||||||
|
|
||||||
[lint]
|
|
||||||
preview = true
|
|
||||||
select = ["I", "PL", "UP"]
|
|
||||||
|
|
||||||
extend-select = [
|
|
||||||
"D419", # empty-docstring
|
|
||||||
"E501", # line-too-long
|
|
||||||
"W291", # trailing-whitespace
|
|
||||||
"PLC0414", # useless-import-alias
|
|
||||||
"PLC2401", # non-ascii-name
|
|
||||||
"PLC2801", # unnecessary-dunder-call
|
|
||||||
"PLC3002", # unnecessary-direct-lambda-call
|
|
||||||
"E999", # syntax-error
|
|
||||||
"PLE0101", # return-in-init
|
|
||||||
"F706", # return-outside-function
|
|
||||||
"F704", # yield-outside-function
|
|
||||||
"PLE0116", # continue-in-finally
|
|
||||||
"PLE0117", # nonlocal-without-binding
|
|
||||||
"PLE0241", # duplicate-bases
|
|
||||||
"PLE0302", # unexpected-special-method-signature
|
|
||||||
"PLE0604", # invalid-all-object
|
|
||||||
"PLE0605", # invalid-all-format
|
|
||||||
"PLE0643", # potential-index-error
|
|
||||||
"PLE0704", # misplaced-bare-raise
|
|
||||||
"PLE1141", # dict-iter-missing-items
|
|
||||||
"PLE1142", # await-outside-async
|
|
||||||
"PLE1205", # logging-too-many-args
|
|
||||||
"PLE1206", # logging-too-few-args
|
|
||||||
"PLE1307", # bad-string-format-type
|
|
||||||
"PLE1310", # bad-str-strip-call
|
|
||||||
"PLE1507", # invalid-envvar-value
|
|
||||||
"PLE2502", # bidirectional-unicode
|
|
||||||
"PLE2510", # invalid-character-backspace
|
|
||||||
"PLE2512", # invalid-character-sub
|
|
||||||
"PLE2513", # invalid-character-esc
|
|
||||||
"PLE2514", # invalid-character-nul
|
|
||||||
"PLE2515", # invalid-character-zero-width-space
|
|
||||||
"PLR0124", # comparison-with-itself
|
|
||||||
"PLR0202", # no-classmethod-decorator
|
|
||||||
"PLR0203", # no-staticmethod-decorator
|
|
||||||
"UP004", # useless-object-inheritance
|
|
||||||
"PLR0206", # property-with-parameters
|
|
||||||
"PLR0904", # too-many-public-methods
|
|
||||||
"PLR0911", # too-many-return-statements
|
|
||||||
"PLR0912", # too-many-branches
|
|
||||||
"PLR0913", # too-many-arguments
|
|
||||||
"PLR0914", # too-many-locals
|
|
||||||
"PLR0915", # too-many-statements
|
|
||||||
"PLR0916", # too-many-boolean-expressions
|
|
||||||
"PLR1702", # too-many-nested-blocks
|
|
||||||
"PLR1704", # redefined-argument-from-local
|
|
||||||
"PLR1711", # useless-return
|
|
||||||
"C416", # unnecessary-comprehension
|
|
||||||
"PLR1733", # unnecessary-dict-index-lookup
|
|
||||||
"PLR1736", # unnecessary-list-index-lookup
|
|
||||||
|
|
||||||
# ruff reports this rule is unstable
|
|
||||||
#"PLR6301", # no-self-use
|
|
||||||
|
|
||||||
"PLW0108", # unnecessary-lambda
|
|
||||||
"PLW0120", # useless-else-on-loop
|
|
||||||
"PLW0127", # self-assigning-variable
|
|
||||||
"PLW0129", # assert-on-string-literal
|
|
||||||
"B033", # duplicate-value
|
|
||||||
"PLW0131", # named-expr-without-context
|
|
||||||
"PLW0245", # super-without-brackets
|
|
||||||
"PLW0406", # import-self
|
|
||||||
"PLW0602", # global-variable-not-assigned
|
|
||||||
"PLW0603", # global-statement
|
|
||||||
"PLW0604", # global-at-module-level
|
|
||||||
|
|
||||||
# fails on the try: import typing used by libraries
|
|
||||||
#"F401", # unused-import
|
|
||||||
|
|
||||||
"F841", # unused-variable
|
|
||||||
"E722", # bare-except
|
|
||||||
"PLW0711", # binary-op-exception
|
|
||||||
"PLW1501", # bad-open-mode
|
|
||||||
"PLW1508", # invalid-envvar-default
|
|
||||||
"PLW1509", # subprocess-popen-preexec-fn
|
|
||||||
"PLW2101", # useless-with-lock
|
|
||||||
"PLW3301", # nested-min-max
|
|
||||||
]
|
|
||||||
|
|
||||||
ignore = [
|
|
||||||
"PLR2004", # magic-value-comparison
|
|
||||||
"UP030", # format literals
|
|
||||||
"PLW1514", # unspecified-encoding
|
|
||||||
"PLR0913", # too-many-arguments
|
|
||||||
"PLR0915", # too-many-statements
|
|
||||||
"PLR0917", # too-many-positional-arguments
|
|
||||||
"PLR0904", # too-many-public-methods
|
|
||||||
"PLR0912", # too-many-branches
|
|
||||||
"PLR0916", # too-many-boolean-expressions
|
|
||||||
]
|
|
||||||
|
|
||||||
[format]
|
|
||||||
line-ending = "lf"
|
|
||||||
57
setup.py
Normal file
57
setup.py
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
"""A setuptools based setup module.
|
||||||
|
|
||||||
|
See:
|
||||||
|
https://packaging.python.org/en/latest/distributing.html
|
||||||
|
https://github.com/pypa/sampleproject
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Always prefer setuptools over distutils
|
||||||
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
|
# To use a consistent encoding
|
||||||
|
from codecs import open
|
||||||
|
from os import path
|
||||||
|
|
||||||
|
here = path.abspath(path.dirname(__file__))
|
||||||
|
|
||||||
|
# Get the long description from the README file
|
||||||
|
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
|
||||||
|
long_description = f.read()
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name="adafruit-circuitpython-is31fl3741",
|
||||||
|
use_scm_version=True,
|
||||||
|
setup_requires=["setuptools_scm"],
|
||||||
|
description="CircuitPython library for IS31FL3741 RGB LED matrices.",
|
||||||
|
long_description=long_description,
|
||||||
|
long_description_content_type="text/x-rst",
|
||||||
|
# The project's main homepage.
|
||||||
|
url="https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3741",
|
||||||
|
# Author details
|
||||||
|
author="Adafruit Industries",
|
||||||
|
author_email="circuitpython@adafruit.com",
|
||||||
|
install_requires=["Adafruit-Blinka"],
|
||||||
|
# Choose your license
|
||||||
|
license="MIT",
|
||||||
|
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||||
|
classifiers=[
|
||||||
|
"Development Status :: 3 - Alpha",
|
||||||
|
"Intended Audience :: Developers",
|
||||||
|
"Topic :: Software Development :: Libraries",
|
||||||
|
"Topic :: System :: Hardware",
|
||||||
|
"License :: OSI Approved :: MIT License",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"Programming Language :: Python :: 3.4",
|
||||||
|
"Programming Language :: Python :: 3.5",
|
||||||
|
],
|
||||||
|
# What does your project relate to?
|
||||||
|
keywords="adafruit is31fl3741 led matrix charlieplex featherwing"
|
||||||
|
"breakout hardware micropython circuitpython",
|
||||||
|
# You can just specify the packages manually here if your project is
|
||||||
|
# simple. Or you can use find_packages().
|
||||||
|
packages=["adafruit_is31fl3741"],
|
||||||
|
)
|
||||||
Loading…
Reference in a new issue