MP3 Music Player
Overview
MP3 playback module that can be controlled via software serial port to play songs stored in memory.
Technical Specifications
Operating voltage: VCC 3.3V -5V
Module dimensions: 32*48mm
Mounting: 2 plastic building block compatible through-holes
Communication: Serial port, baud rate 9600
File formats: MP3/WAV
Pin Definition
Pin |
Definition |
|---|---|
GND |
Ground |
VCC |
Power |
TX |
Serial transmit |
RX |
Serial receive |
Example Code
Press button A to pause the song; press button B to resume playback.
from mpython import *
from bluebit import *
mp3_1 = MP3_(uart_num=1,tx=Pin.P1)
def on_button_a_pressed(_):
global classify_id
mp3_1.pause()
button_a.event_pressed = on_button_a_pressed
def on_button_b_pressed(_):
global classify_id
mp3_1.play()
button_b.event_pressed = on_button_b_pressed
mp3_1.volume(10)
mp3_1.play_song(1)