We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0a5a9aa + b4e475f commit 781c8e7Copy full SHA for 781c8e7
adafruit_seesaw/tftshield18.py
@@ -66,7 +66,12 @@ class TFTShield18(Seesaw):
66
# TypeError: unsupported operand type(s) for <<: 'int' and '_MockObject'
67
_button_mask = 0xFF
68
69
- def __init__(self, i2c_bus=board.I2C(), addr=0x2E):
+ def __init__(self, i2c_bus=None, addr=0x2E):
70
+ if i2c_bus is None:
71
+ try:
72
+ i2c_bus = board.I2C()
73
+ except AttributeError as attrError:
74
+ raise ValueError("Board has no default I2C bus.") from attrError
75
super().__init__(i2c_bus, addr)
76
self.pin_mode(_TFTSHIELD_RESET_PIN, self.OUTPUT)
77
self.pin_mode_bulk(self._button_mask, self.INPUT_PULLUP)
0 commit comments