音乐播放MP3 =================== .. figure:: /_static/products/ledong-module/static/图片/MP3.png :width: 55% :align: center 概述 -------------------- MP3播放模块,可通过软串口发送指令操控播放内存中保存的歌曲。 技术参数 ------------------- 工作电压: VCC 3.3V -5V 模块尺寸:32*48mm 固定安装:2个兼容塑料积木通孔 通讯方式:串口,波特率9600 文件格式:MP3/WAV 引脚定义 ------------------- ===== ======== 引脚 定义 ===== ======== GND 地 VCC 电源 TX 串口发送 RX 串口接收 ===== ======== 示例程序 ------------------- **按A键暂停歌曲;按B键继续播放。** .. code-block:: python 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) .. figure:: /_static/products/ledong-module/static/examples/MP3.png :width: 100% :align: center