File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44Please support Adafruit and open source hardware by purchasing
55products from Adafruit!
66Written by Kattni Rembor & Limor Fried for Adafruit Industries
7- Copyright (c) 2019 Adafruit Industries
7+ Copyright (c) 2019-2020 Adafruit Industries
88Licensed under the MIT license.
99All text above must be included in any redistribution.
1010"""
1313import random
1414import digitalio
1515import audioio
16- import busio
16+ import audiocore
1717import board
1818import neopixel
1919import adafruit_lis3dh
5353wave_file = None
5454
5555# Set up accelerometer on I2C bus, 4G range:
56- i2c = busio .I2C (board . SCL , board . SDA )
56+ i2c = board .I2C ()
5757accel = adafruit_lis3dh .LIS3DH_I2C (i2c )
5858accel .range = adafruit_lis3dh .RANGE_4_G
5959
@@ -76,7 +76,7 @@ def play_wav(name, loop=False):
7676 wave_file .close ()
7777 try :
7878 wave_file = open ('sounds/' + name + '.wav' , 'rb' )
79- wave = audioio .WaveFile (wave_file )
79+ wave = audiocore .WaveFile (wave_file )
8080 audio .play (wave , loop = loop )
8181 except OSError :
8282 pass # we'll just skip playing then
You can’t perform that action at this time.
0 commit comments