File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
CircuitPython_LED_Sand_Hourglass/hourglass Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 44
55import time
66import board
7- import adafruit_lsm6ds .lsm6ds33
87from adafruit_ht16k33 import matrix
98import matrixsand
109
1413i2c = board .I2C () # uses board.SCL and board.SDA
1514# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
1615
17- # the accelo
18- accelo = adafruit_lsm6ds .lsm6ds33 .LSM6DS33 (i2c )
16+ # check for LSM6DS33 or LSM6DS3TR-C (Adafruit Feather Sense)
17+ try :
18+ 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+ accelo = LSM6DS (i2c )
1923
2024# the matrices
2125m1 = matrix .Matrix8x8 (i2c , 0x70 )
You can’t perform that action at this time.
0 commit comments