Skip to content

Commit d2ab3a3

Browse files
committed
adding play_mp3 example
1 parent 6232174 commit d2ab3a3

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""
2+
This example plays mp3 audio files from the built-in speaker when the A or B buttons are pressed.
3+
4+
NOTE: This example does NOT support Circuit Playground Express.
5+
"""
6+
from adafruit_circuitplayground import cp
7+
8+
while True:
9+
if cp.button_a:
10+
cp.play_mp3("dip.mp3")
11+
if cp.button_b:
12+
cp.play_mp3("rise.mp3")

examples/dip.mp3

5.51 KB
Binary file not shown.

examples/rise.mp3

5.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)