|
使用STC89C52來(lái)實(shí)現(xiàn)
播放揮著翅膀的女孩和同一首歌還有兩只蝴蝶
其中包含兩個(gè).h和一個(gè).c文件
.c內(nèi)容如下
兩個(gè).h分別是SoundPlay函數(shù),以及歌曲16進(jìn)制數(shù)組
- #include "reg52.h" //此文件中定義了單片機(jī)的一些特殊功能寄存器
- #include "SoundPlay.h"
- #include"music.h"
- typedef unsigned int u16; //對(duì)數(shù)據(jù)類型進(jìn)行聲明定義
- 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);
- }
- }
復(fù)制代碼
|
-
-
音樂播放器.rar
2018-1-8 09:48 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
32.91 KB, 下載次數(shù): 57, 下載積分: 黑幣 -5
|