From a6e77185ac14728b1c4bc18f3c92ebfc95d9f49e Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Sat, 19 Dec 2020 13:42:33 -0500 Subject: [PATCH 1/2] pass additonla pins as arguments --- adafruit_featherwing/keyboard_featherwing.py | 26 ++++++++++++++------ 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/adafruit_featherwing/keyboard_featherwing.py b/adafruit_featherwing/keyboard_featherwing.py index 1bf0ba8..756981e 100644 --- a/adafruit_featherwing/keyboard_featherwing.py +++ b/adafruit_featherwing/keyboard_featherwing.py @@ -48,31 +48,43 @@ # pylint: disable-msg=too-few-public-methods +# pylint: disable-msg=too-many-arguments class KeyboardFeatherwing: """Class representing a `Keyboard Featherwing` `_. """ - def __init__(self, spi=None, cs=None, dc=None, i2c=None): + def __init__( + self, + spi=None, + cs=None, + dc=None, + i2c=None, + ts_cs=None, + sd_cs=None, + neopixel_pin=None, + ): displayio.release_displays() if spi is None: spi = board.SPI() if cs is None: cs = board.D9 - if dc is None: - dc = board.D10 if i2c is None: i2c = board.I2C() + if ts_cs is None: + ts_cs = board.D6 + if sd_cs is None: + sd_cs = board.D5 + if neopixel_pin is None: + neopixel_pin = board.D11 - ts_cs = digitalio.DigitalInOut(board.D6) - self.touchscreen = Adafruit_STMPE610_SPI(spi, ts_cs) + self.touchscreen = Adafruit_STMPE610_SPI(spi, digitalio.DigitalInOut(ts_cs)) display_bus = displayio.FourWire(spi, command=dc, chip_select=cs) self.display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240) - self.neopixel = neopixel.NeoPixel(board.D11, 1) + self.neopixel = neopixel.NeoPixel(neopixel_pin, 1) self.keyboard = BBQ10Keyboard(i2c) - sd_cs = board.D5 self._sdcard = None try: self._sdcard = sdcardio.SDCard(spi, sd_cs) From b198222541571a5c62c673e87365ef19decf37d3 Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Sat, 19 Dec 2020 15:29:57 -0500 Subject: [PATCH 2/2] restore default for dc --- adafruit_featherwing/keyboard_featherwing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adafruit_featherwing/keyboard_featherwing.py b/adafruit_featherwing/keyboard_featherwing.py index 756981e..5832aed 100644 --- a/adafruit_featherwing/keyboard_featherwing.py +++ b/adafruit_featherwing/keyboard_featherwing.py @@ -70,6 +70,8 @@ def __init__( spi = board.SPI() if cs is None: cs = board.D9 + if dc is None: + dc = board.D10 if i2c is None: i2c = board.I2C() if ts_cs is None: