Skip to content

Update HalloWing jump sound #2955

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 1 commit into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
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
17 changes: 15 additions & 2 deletions Hallowing_Jump_Sound/jump-sound/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,21 @@ def play_wav(wav):
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:
Expand Down
17 changes: 15 additions & 2 deletions Hallowing_Jump_Sound/stomp-and-roar/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,21 @@ def load_wav(name):
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:
Expand Down
Loading