We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 015b1f3 + 92ac6f3 commit 77bd7dbCopy full SHA for 77bd7db
1 file changed
CircuitPython_LED_Sand_Hourglass/single_matrix/code.py
@@ -4,7 +4,6 @@
4
5
import time
6
import board
7
-import adafruit_lsm6ds.lsm6ds33
8
from adafruit_ht16k33 import matrix
9
import matrixsand
10
@@ -14,8 +13,13 @@
14
13
i2c = board.I2C() # uses board.SCL and board.SDA
15
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
16
17
-# the accelo
18
-accelo = adafruit_lsm6ds.lsm6ds33.LSM6DS33(i2c)
+# check for LSM6DS33 or LSM6DS3TR-C (Adafruit Feather Sense)
+try:
+ from adafruit_lsm6ds.lsm6ds33 import LSM6DS33 as LSM6DS # pylint: disable=unused-import
19
+ accelo = LSM6DS(i2c)
20
+except RuntimeError:
21
+ from adafruit_lsm6ds.lsm6ds3 import LSM6DS3 as LSM6DS # pylint: disable=unused-import
22
23
24
# the matrix
25
matrix = matrix.Matrix8x8(i2c, 0x70)
0 commit comments