Skip to content

Commit 87d2f6b

Browse files
authored
Update code.py
1 parent e160527 commit 87d2f6b

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

CPX_Sound_Box/code.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
import time
12
import board
23
from digitalio import DigitalInOut, Direction, Pull
34
import audioio
45
import neopixel
5-
import time
66

77
filename = "electrons.wav"
88

9-
# What pad our button is connected to:
9+
# The pad our button is connected to:
1010
button = DigitalInOut(board.A4)
1111
button.direction = Direction.INPUT
1212
button.pull = Pull.UP
@@ -34,14 +34,13 @@ def simpleCircle(wait):
3434
time.sleep(wait)
3535

3636
# Audio Play File
37-
def play_file(filename):
38-
print("Playing File" + filename)
39-
wave_file = open(filename, "rb")
37+
def play_file(playname):
38+
print("Playing File " + playname)
39+
wave_file = open(playname, "rb")
4040
with audioio.WaveFile(wave_file) as wave:
4141
with audioio.AudioOut(board.A0) as audio:
4242
audio.play(wave)
4343
while audio.playing:
44-
pass
4544
simpleCircle(.02)
4645
print("finished")
4746

0 commit comments

Comments
 (0)