Skip to content

Commit 381789d

Browse files
committed
Skip crickit singleton if no board.SCL
1 parent fa5e15c commit 381789d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

adafruit_crickit/crickit.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,5 +302,9 @@ def reset(self):
302302
"""Reset the whole Crickit board."""
303303
self._seesaw.sw_reset()
304304

305-
crickit = Crickit(Seesaw(busio.I2C(board.SCL, board.SDA))) # pylint: disable=invalid-name
305+
crickit = None
306306
"""A singleton instance to control a single Crickit board, controlled by the default I2C pins."""
307+
308+
# Sphinx's board is missing real pins so skip the constructor in that case.
309+
if "SCL" in dir(board):
310+
crickit = Crickit(Seesaw(busio.I2C(board.SCL, board.SDA))) # pylint: disable=invalid-name

0 commit comments

Comments
 (0)