Skip to content

Commit ec8aeca

Browse files
authored
Merge pull request #66 from jerryneedell/jerryn_keyboard_featherwing
pass additonal pins as arguments
2 parents 599c42f + b198222 commit ec8aeca

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

adafruit_featherwing/keyboard_featherwing.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,23 @@
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()
@@ -64,15 +74,19 @@ def __init__(self, spi=None, cs=None, dc=None, i2c=None):
6474
dc = board.D10
6575
if i2c is None:
6676
i2c = board.I2C()
77+
if ts_cs is None:
78+
ts_cs = board.D6
79+
if sd_cs is None:
80+
sd_cs = board.D5
81+
if neopixel_pin is None:
82+
neopixel_pin = board.D11
6783

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

7186
display_bus = displayio.FourWire(spi, command=dc, chip_select=cs)
7287
self.display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
73-
self.neopixel = neopixel.NeoPixel(board.D11, 1)
88+
self.neopixel = neopixel.NeoPixel(neopixel_pin, 1)
7489
self.keyboard = BBQ10Keyboard(i2c)
75-
sd_cs = board.D5
7690
self._sdcard = None
7791
try:
7892
self._sdcard = sdcardio.SDCard(spi, sd_cs)

0 commit comments

Comments
 (0)