-
Notifications
You must be signed in to change notification settings - Fork 10
Add optional LED buffering #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Thanks for this pull request! Unfortunately, it looks like the automated continuous integration (CI) test(s) failed. These can be tricky to fix so we've written a guide on how to fix them locally. It has pages about running pre-commit locally and another about building the docs locally with sphinx. Thanks for contributing to CircuitPython! If you have more questions, feel free to join the Adafruit Discord and post in #circuitpython-dev. |
nice! |
Updating https://github.com/adafruit/Adafruit_CircuitPython_AS7341 to 1.2.0 from 1.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_AS7341#19 from bjones14/main > Moved CI to Python 3.7 > Added help text and problem matcher > Added pull request template Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107 to 1.4.1 from 1.4.0: > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SH1107#10 from lesamouraipourpre/cpython > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SH1107#9 from lesamouraipourpre/multiplex Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol to 0.5.7 from 0.5.6: > Merge pull request adafruit/Adafruit_CircuitPython_ESP_ATcontrol#41 from PontusO/main Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3741 to 1.1.1 from 1.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3741#5 from adafruit/philb-bytes > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3741#3 from rhooper/grid > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3741#4 from adafruit/philb-buffer Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 8.1.0 from 8.0.3: > Merge pull request adafruit/Adafruit_CircuitPython_BLE#135 from tannewt/connect_to_address Updating https://github.com/adafruit/Adafruit_CircuitPython_MIDI to 1.4.3 from 1.4.2: > Merge pull request adafruit/Adafruit_CircuitPython_MIDI#41 from EMATech/mtc Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 1.9.2 from 1.9.1: > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#49 from makermelissa/main Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Added the following libraries: Adafruit_CircuitPython_UC8151D
This PR adds a buffering capability that can optionally be enabled via constructor. A “buffered” IS31FL3741 has LED PWM state stored in RAM, pushed to the chip only when show() is called. This can provide smoother and faster animation, in exchange for a little over 1/3 K of RAM, and having to periodically call show(). Inspired by similar additions to the Arduino version of this library.
This currently only covers the LED glasses. Support for the QT RGB matrix and the eval board will be added tomorrow, when I’ve had some time to test. (Edit: I think these pick up the change automatically, since there’s no extra constructor as with the glasses…still need to change imports to get those constants though.)
Default behavior is to work as originally written; LEDs are unbuffered. Enabling buffering requires some changes to import statements and arguments to constructors. See the LED glasses rings example.
The optional “allocate” argument can have one of three values, declared in adafruit_is31fl3741:
Additionally, this fixes a small math error that caused the glasses rings example to have occasional speckles.