Update code.py
Update for either of the accelerometers on the Feather Sense
This commit is contained in:
parent
77bd7db8fe
commit
fac7d8155e
1 changed files with 7 additions and 3 deletions
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import board
|
import board
|
||||||
import adafruit_lsm6ds.lsm6ds33
|
|
||||||
from adafruit_ht16k33 import matrix
|
from adafruit_ht16k33 import matrix
|
||||||
import matrixsand
|
import matrixsand
|
||||||
|
|
||||||
|
|
@ -14,8 +13,13 @@ DELAY = 0.05 # overall update rate
|
||||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||||
|
|
||||||
# the accelo
|
# check for LSM6DS33 or LSM6DS3TR-C (Adafruit Feather Sense)
|
||||||
accelo = adafruit_lsm6ds.lsm6ds33.LSM6DS33(i2c)
|
try:
|
||||||
|
from adafruit_lsm6ds.lsm6ds33 import LSM6DS33 as LSM6DS # pylint: disable=unused-import
|
||||||
|
accelo = LSM6DS(i2c)
|
||||||
|
except RuntimeError:
|
||||||
|
from adafruit_lsm6ds.lsm6ds3 import LSM6DS3 as LSM6DS # pylint: disable=unused-import
|
||||||
|
accelo = LSM6DS(i2c)
|
||||||
|
|
||||||
# the matrices
|
# the matrices
|
||||||
m1 = matrix.Matrix8x8(i2c, 0x70)
|
m1 = matrix.Matrix8x8(i2c, 0x70)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue