diff --git a/README.rst b/README.rst index 912d2ba..bada9ef 100644 --- a/README.rst +++ b/README.rst @@ -23,7 +23,7 @@ This driver supports the following hardware: * `Pimoroni 17x7 Scroll pHAT HD `_ * `Pimoroni 28x3 (r,g,b) Led Shim `_ * `Pimoroni Keybow 2040 with 4x4 matrix of RGB LEDs `_ - +* `Pimoroni 11x7 LED Matrix Breakout `_ Dependencies ============= diff --git a/adafruit_is31fl3731.py b/adafruit_is31fl3731.py index bc1a1c3..98a3b17 100644 --- a/adafruit_is31fl3731.py +++ b/adafruit_is31fl3731.py @@ -28,6 +28,9 @@ * Pimoroni Keybow 2040 _ +* Pimoroni 11x7 Matrix + + **Software and Dependencies:** * Adafruit CircuitPython firmware (2.2.0+) for the ESP8622 and M0-based boards: @@ -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"""