Skip to content

Commit

Permalink
Skip crickit singleton if no board.SCL
Browse files Browse the repository at this point in the history
  • Loading branch information
tannewt committed Jun 30, 2018
1 parent fa5e15c commit 381789d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion adafruit_crickit/crickit.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,9 @@ def reset(self):
"""Reset the whole Crickit board."""
self._seesaw.sw_reset()

crickit = Crickit(Seesaw(busio.I2C(board.SCL, board.SDA))) # pylint: disable=invalid-name
crickit = None
"""A singleton instance to control a single Crickit board, controlled by the default I2C pins."""

# Sphinx's board is missing real pins so skip the constructor in that case.
if "SCL" in dir(board):
crickit = Crickit(Seesaw(busio.I2C(board.SCL, board.SDA))) # pylint: disable=invalid-name

0 comments on commit 381789d

Please sign in to comment.