Skip to content

Add RGB color ordering a la Arduino library, FrameBuffer copy via image() #9

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

Merged
merged 6 commits into from
Oct 7, 2021

Conversation

PaintYourDragon
Copy link
Contributor

Principal change here is the addition of different RGB byte orders, to provide compatibility with the initial batch of STEMMA QT matrices and also future-proof against possible future changes to RGB LED pinouts. All of the high-level class constructors (ISSI_EVB, Adafruit_RGBMatrixQT and LED_Glasses) accept an optional “order” argument, with a similar color order to the Arduino library:
matrix = Adafruit_RGBMatrixQT(i2c, order = adafruit_is31fl3741.IS3741_RBG)
The default order if unspecified is IS3741_BGR, compatible with ISSI eval board, currently-shipping QT matrices, and EyeLights glasses.
The initial batch of QT matrices had a different type of LED: use IS3741_RBG there.

Tested against Arduino library, all color orders work similarly, both in direct and buffered modes.

Additional change is that in CircuitPython the image() function accepts a FrameBuffer object. Since the IS31 library itself doesn’t provide any drawing primitives, one can use adafruit_framebuffer instead, then image() the result to the RGB matrix. (Haven't benchmarked, but potentially faster in some situations.) It’s primitive and doesn’t trap mismatches — the FrameBuffer and matrix need to be the same size — but it’s a start.

Additionally, the pixel-setter function may be a smidge faster now, some bounds checks weren’t necessary.

@github-actions
Copy link

github-actions bot commented Oct 7, 2021

👋 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.

@PaintYourDragon PaintYourDragon merged commit 8b0a931 into main Oct 7, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Oct 8, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_ATECC to 1.2.7 from 1.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_ATECC#26 from silvester/main
  > Globally disabled consider-using-f-string pylint check
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3741 to 1.1.3 from 1.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3741#9 from adafruit/pb-color-order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants