Skip to content

Add Pimoroni 11x7 LED Matrix Breakout #37

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This driver supports the following hardware:
* `Pimoroni 17x7 Scroll pHAT HD <https://www.adafruit.com/product/3473>`_
* `Pimoroni 28x3 (r,g,b) Led Shim <https://www.adafruit.com/product/3831>`_
* `Pimoroni Keybow 2040 with 4x4 matrix of RGB LEDs <https://shop.pimoroni.com/products/keybow-2040>`_

* `Pimoroni 11x7 LED Matrix Breakout <https://shop.pimoroni.com/products/11x7-led-matrix-breakout>`_

Dependencies
=============
Expand Down
22 changes: 22 additions & 0 deletions adafruit_is31fl3731.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
* Pimoroni Keybow 2040
<https://shop.pimoroni.com/products/keybow-2040>_

* Pimoroni 11x7 Matrix
<https://shop.pimoroni.com/products/11x7-led-matrix-breakout>

**Software and Dependencies:**

* Adafruit CircuitPython firmware (2.2.0+) for the ESP8622 and M0-based boards:
Expand Down Expand Up @@ -399,6 +402,25 @@ def pixel_addr(x, y):
return x * 16 + y


class Matrix11x7(Matrix):
"""Supports the 11x7 LED Matrix Breakout by Pimoroni"""

width = 11
height = 7

def __init__(self, i2c, address=0x75):
super().__init__(i2c, address)

@staticmethod
def pixel_addr(x, y):
"""Translate an x,y coordinate to a pixel index."""
if x <= 5:
r = x * 16 + y
else:
r = (x - 5) * 16 + y - 8
return r


class LedShim(Matrix):
"""Supports the LED SHIM by Pimoroni"""

Expand Down