Skip to content

Added DC and CS Options to Mini TFT FeatherWing #41

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

Merged
merged 2 commits into from
May 1, 2019
Merged
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
13 changes: 8 additions & 5 deletions adafruit_featherwing/minitft_featherwing.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,16 @@ class MiniTFTFeatherWing:
(1 << BUTTON_SEL) |
(1 << BUTTON_A) |
(1 << BUTTON_B))

def __init__(self, address=0x5E, i2c=None, spi=None):
#pylint: disable-msg=too-many-arguments
def __init__(self, address=0x5E, i2c=None, spi=None, cs=None, dc=None):
if i2c is None:
i2c = board.I2C()
if spi is None:
spi = board.SPI()
if cs is None:
cs = board.D5
if dc is None:
dc = board.D6
self._ss = Seesaw(i2c, address)
self._backlight = PWMOut(self._ss, 5)
self._backlight.duty_cycle = 0
Expand All @@ -80,12 +84,11 @@ def __init__(self, address=0x5E, i2c=None, spi=None):
spi.unlock()
self._ss.pin_mode(8, self._ss.OUTPUT)
self._ss.digital_write(8, True) # Reset the Display via Seesaw
display_bus = displayio.FourWire(spi,
command=board.D6,
chip_select=board.D5)
display_bus = displayio.FourWire(spi, command=dc, chip_select=cs)
self.display = ST7735R(display_bus, width=160, height=80, colstart=24,
rotation=270, bgr=True)
self._ss.pin_mode_bulk(self._button_mask, self._ss.INPUT_PULLUP)
#pylint: enable-msg=too-many-arguments

@property
def backlight(self):
Expand Down