Skip to content

Commit a6e7718

Browse files
committed
pass additonla pins as arguments
1 parent 599c42f commit a6e7718

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

adafruit_featherwing/keyboard_featherwing.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,31 +48,43 @@
4848

4949

5050
# pylint: disable-msg=too-few-public-methods
51+
# pylint: disable-msg=too-many-arguments
5152
class KeyboardFeatherwing:
5253
"""Class representing a `Keyboard Featherwing`
5354
<https://www.tindie.com/products/arturo182/keyboard-featherwing-qwerty-keyboard-26-lcd/>`_.
5455
5556
"""
5657

57-
def __init__(self, spi=None, cs=None, dc=None, i2c=None):
58+
def __init__(
59+
self,
60+
spi=None,
61+
cs=None,
62+
dc=None,
63+
i2c=None,
64+
ts_cs=None,
65+
sd_cs=None,
66+
neopixel_pin=None,
67+
):
5868
displayio.release_displays()
5969
if spi is None:
6070
spi = board.SPI()
6171
if cs is None:
6272
cs = board.D9
63-
if dc is None:
64-
dc = board.D10
6573
if i2c is None:
6674
i2c = board.I2C()
75+
if ts_cs is None:
76+
ts_cs = board.D6
77+
if sd_cs is None:
78+
sd_cs = board.D5
79+
if neopixel_pin is None:
80+
neopixel_pin = board.D11
6781

68-
ts_cs = digitalio.DigitalInOut(board.D6)
69-
self.touchscreen = Adafruit_STMPE610_SPI(spi, ts_cs)
82+
self.touchscreen = Adafruit_STMPE610_SPI(spi, digitalio.DigitalInOut(ts_cs))
7083

7184
display_bus = displayio.FourWire(spi, command=dc, chip_select=cs)
7285
self.display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
73-
self.neopixel = neopixel.NeoPixel(board.D11, 1)
86+
self.neopixel = neopixel.NeoPixel(neopixel_pin, 1)
7487
self.keyboard = BBQ10Keyboard(i2c)
75-
sd_cs = board.D5
7688
self._sdcard = None
7789
try:
7890
self._sdcard = sdcardio.SDCard(spi, sd_cs)

0 commit comments

Comments
 (0)