Skip to content

Commit af7729e

Browse files
authored
Merge pull request #41 from makermelissa/master
Added DC and CS Options to Mini TFT FeatherWing
2 parents 781b4ef + dbc46d9 commit af7729e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

adafruit_featherwing/minitft_featherwing.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,16 @@ class MiniTFTFeatherWing:
6363
(1 << BUTTON_SEL) |
6464
(1 << BUTTON_A) |
6565
(1 << BUTTON_B))
66-
67-
def __init__(self, address=0x5E, i2c=None, spi=None):
66+
#pylint: disable-msg=too-many-arguments
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,12 +84,11 @@ 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)
91+
#pylint: enable-msg=too-many-arguments
8992

9093
@property
9194
def backlight(self):

0 commit comments

Comments
 (0)