Skip to content

Commit c8e016b

Browse files
committed
Add alt_rgb_pins as requested
1 parent 00dccdf commit c8e016b

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

adafruit_matrixportal/graphics.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Graphics:
4242
:param int height: The height of the display in Pixels. Defaults to 32.
4343
:param int bit_depth: The number of bits per color channel. Defaults to 2.
4444
:param list alt_addr_pins: An alternate set of address pins to use. Defaults to None
45+
:param list alt_rgb_pins: An alternate set of rgb pins to use. Defaults to None
4546
:param debug: Turn on debug print outs. Defaults to False.
4647
4748
"""
@@ -55,12 +56,17 @@ def __init__(
5556
height=32,
5657
bit_depth=2,
5758
alt_addr_pins=None,
59+
alt_rgb_pins=None,
5860
debug=False
5961
):
6062

6163
self._debug = debug
6264
matrix = Matrix(
63-
bit_depth=bit_depth, width=width, height=height, alt_addr_pins=alt_addr_pins
65+
bit_depth=bit_depth,
66+
width=width,
67+
height=height,
68+
alt_addr_pins=alt_addr_pins,
69+
alt_rgb_pins=alt_rgb_pins,
6470
)
6571
self.display = matrix.display
6672

adafruit_matrixportal/matrix.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,14 @@ class Matrix:
4545
:param int height: The height of the display in Pixels. Defaults to 32.
4646
:param int bit_depth: The number of bits per color channel. Defaults to 2.
4747
:param list alt_addr_pins: An alternate set of address pins to use. Defaults to None
48+
:param list alt_rgb_pins: An alternate set of rgb pins to use. Defaults to None
4849
4950
"""
5051

5152
# pylint: disable=too-few-public-methods,too-many-branches
52-
def __init__(self, *, width=64, height=32, bit_depth=2, alt_addr_pins=None):
53+
def __init__(
54+
self, *, width=64, height=32, bit_depth=2, alt_addr_pins=None, alt_rgb_pins=None
55+
):
5356

5457
if "Matrix Portal M4" in os.uname().machine:
5558
# MatrixPortal M4 Board
@@ -105,6 +108,10 @@ def __init__(self, *, width=64, height=32, bit_depth=2, alt_addr_pins=None):
105108
latch_pin = board.D10
106109
oe_pin = board.D9
107110

111+
# Alternate Address Pins
112+
if alt_rgb_pins is not None:
113+
rgb_pins = alt_rgb_pins
114+
108115
# Alternate Address Pins
109116
if alt_addr_pins is not None:
110117
addr_pins = alt_addr_pins

adafruit_matrixportal/matrixportal.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class MatrixPortal:
5858
:param busio.SPI external_spi: A previously declared spi object. Defaults to ``None``.
5959
:param int bit_depth: The number of bits per color channel. Defaults to 2.
6060
:param list alt_addr_pins: An alternate set of address pins to use. Defaults to None
61+
:param list alt_rgb_pins: An alternate set of rgb pins to use. Defaults to None
6162
:param debug: Turn on debug print outs. Defaults to False.
6263
6364
"""
@@ -77,6 +78,7 @@ def __init__(
7778
external_spi=None,
7879
bit_depth=2,
7980
alt_addr_pins=None,
81+
alt_rgb_pins=None,
8082
debug=False
8183
):
8284

@@ -87,6 +89,7 @@ def __init__(
8789
width=64,
8890
height=32,
8991
alt_addr_pins=alt_addr_pins,
92+
alt_rgb_pins=alt_rgb_pins,
9093
debug=debug,
9194
)
9295
self.display = self.graphics.display

0 commit comments

Comments
 (0)