Merge pull request #2955 from caternuson/hallo_jump_update

Update HalloWing jump sound
This commit is contained in:
Carter Nelson 2025-01-25 09:30:52 -08:00 committed by GitHub
commit c9f2d95e5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 4 deletions

View file

@ -74,8 +74,21 @@ TOUCH4 = touchio.TouchIn(board.TOUCH4)
i2c = board.I2C() # uses board.SCL and board.SDA
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
if IS_HALLOWING_M4:
import adafruit_msa301
ACCEL = adafruit_msa301.MSA301(i2c)
# i2c scan to determine which accelo
while not i2c.try_lock():
pass
ADDR = i2c.scan()
i2c.unlock()
if 0x26 in ADDR:
# MSA301
from adafruit_msa3xx import MSA301
ACCEL = MSA301(i2c)
elif 0x62 in ADDR:
# MSA311
from adafruit_msa3xx import MSA311
ACCEL = MSA311(i2c)
else:
raise RuntimeError("Accelerometer not found.")
else:
import adafruit_lis3dh
try:

View file

@ -57,8 +57,21 @@ except AttributeError:
i2c = board.I2C() # uses board.SCL and board.SDA
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
if IS_HALLOWING_M4:
import adafruit_msa301
ACCEL = adafruit_msa301.MSA301(i2c)
# i2c scan to determine which accelo
while not i2c.try_lock():
pass
ADDR = i2c.scan()
i2c.unlock()
if 0x26 in ADDR:
# MSA301
from adafruit_msa3xx import MSA301
ACCEL = MSA301(i2c)
elif 0x62 in ADDR:
# MSA311
from adafruit_msa3xx import MSA311
ACCEL = MSA311(i2c)
else:
raise RuntimeError("Accelerometer not found.")
else:
import adafruit_lis3dh
try: