Skip to content

Commit 40246b5

Browse files
Melissa LeBlanc-WilliamsMelissa LeBlanc-Williams
Melissa LeBlanc-Williams
authored and
Melissa LeBlanc-Williams
committed
Added d/c and cs override options
1 parent 781b4ef commit 40246b5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

adafruit_featherwing/minitft_featherwing.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,15 @@ class MiniTFTFeatherWing:
6464
(1 << BUTTON_A) |
6565
(1 << BUTTON_B))
6666

67-
def __init__(self, address=0x5E, i2c=None, spi=None):
67+
def __init__(self, address=0x5E, i2c=None, spi=None, cs=None, dc=None):
6868
if i2c is None:
6969
i2c = board.I2C()
7070
if spi is None:
7171
spi = board.SPI()
72+
if cs is None:
73+
cs = board.D5
74+
if dc is None:
75+
dc = board.D6
7276
self._ss = Seesaw(i2c, address)
7377
self._backlight = PWMOut(self._ss, 5)
7478
self._backlight.duty_cycle = 0
@@ -80,9 +84,7 @@ def __init__(self, address=0x5E, i2c=None, spi=None):
8084
spi.unlock()
8185
self._ss.pin_mode(8, self._ss.OUTPUT)
8286
self._ss.digital_write(8, True) # Reset the Display via Seesaw
83-
display_bus = displayio.FourWire(spi,
84-
command=board.D6,
85-
chip_select=board.D5)
87+
display_bus = displayio.FourWire(spi, command=dc, chip_select=cs)
8688
self.display = ST7735R(display_bus, width=160, height=80, colstart=24,
8789
rotation=270, bgr=True)
8890
self._ss.pin_mode_bulk(self._button_mask, self._ss.INPUT_PULLUP)

0 commit comments

Comments
 (0)