File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 9
9
import displayio
10
10
import adafruit_imageload
11
11
from audiocore import WaveFile
12
- from audioio import AudioOut
13
12
from adafruit_motor import servo
14
13
from digitalio import DigitalInOut , Direction , Pull
15
14
from adafruit_matrixportal .matrix import Matrix
16
15
16
+ I2S_VERSION = False # set to True if using I2S audio out
17
+
18
+ # import the appropriate audio module
19
+ if I2S_VERSION :
20
+ from audiobusio import I2SOut
21
+ else :
22
+ from audioio import AudioOut
23
+
17
24
# setup for down button on matrixportal
18
25
switch = DigitalInOut (board .BUTTON_DOWN )
19
26
switch .direction = Direction .INPUT
36
43
wave = WaveFile (wave_file )
37
44
38
45
# setup for audio out
39
- audio = AudioOut (board .A0 )
46
+ if I2S_VERSION :
47
+ audio = I2SOut (board .A2 , board .A3 , board .TX )
48
+ else :
49
+ audio = AudioOut (board .A0 )
40
50
41
51
# setup for matrix display
42
52
matrix = Matrix (width = 32 , height = 32 )
You can’t perform that action at this time.
0 commit comments