标题: pz科技51单片机之音乐播放器程序 [打印本页]

作者: tree1    时间: 2019-5-25 19:59
标题: pz科技51单片机之音乐播放器程序
#include "reg52.h"             //此文件中定义了单片机的一些特殊功能寄存器
#include "SoundPlay.h"
#include"music.h"

typedef unsigned int u16;      //对数据类型进行声明定义
typedef unsigned char u8;



void Delay1ms(unsigned int count)
{
    unsigned int i,j;
    for(i=0;i<count;i++)
    for(j=0;j<120;j++);
}

void main()
{
    InitialSound();
    while(1)
    {
        Play(Music_Girl,0,3,360);
        
        Delay1ms(500);
        Play(Music_Same,0,3,360);
        Delay1ms(500);
        Play(Music_Two,0,3,360);
        Delay1ms(500);
    }
}

接线图.JPG (170.06 KB, 下载次数: 25)

连接图

连接图

音乐播放器.zip

197.47 KB, 下载次数: 6, 下载积分: 黑币 -5






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1