Skip to content

Update code.py #3108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions CircuitPython_LED_Sand_Hourglass/single_matrix/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import time
import board
import adafruit_lsm6ds.lsm6ds33
from adafruit_ht16k33 import matrix
import matrixsand

Expand All @@ -14,8 +13,13 @@
i2c = board.I2C() # uses board.SCL and board.SDA
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller

# the accelo
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
accelo = LSM6DS(i2c)
except RuntimeError:
from adafruit_lsm6ds.lsm6ds3 import LSM6DS3 as LSM6DS # pylint: disable=unused-import
accelo = LSM6DS(i2c)

# the matrix
matrix = matrix.Matrix8x8(i2c, 0x70)
Expand Down