找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 4726|回復(fù): 0
收起左側(cè)

音樂播放器使用STC89C52實(shí)現(xiàn)

[復(fù)制鏈接]
ID:273029 發(fā)表于 2018-1-8 09:48 | 顯示全部樓層 |閱讀模式
使用STC89C52來(lái)實(shí)現(xiàn)
播放揮著翅膀的女孩和同一首歌還有兩只蝴蝶
其中包含兩個(gè).h和一個(gè).c文件
.c內(nèi)容如下
兩個(gè).h分別是SoundPlay函數(shù),以及歌曲16進(jìn)制數(shù)組


  1. #include "reg52.h"                         //此文件中定義了單片機(jī)的一些特殊功能寄存器
  2. #include "SoundPlay.h"
  3. #include"music.h"

  4. typedef unsigned int u16;          //對(duì)數(shù)據(jù)類型進(jìn)行聲明定義
  5. typedef unsigned char u8;



  6. void Delay1ms(unsigned int count)
  7. {
  8.         unsigned int i,j;
  9.         for(i=0;i<count;i++)
  10.         for(j=0;j<120;j++);
  11. }

  12. void main()
  13. {
  14.         InitialSound();
  15.         while(1)
  16.         {
  17.                 Play(Music_Girl,0,3,360);
  18.                
  19.                 Delay1ms(500);
  20.                 Play(Music_Same,0,3,360);
  21.                 Delay1ms(500);
  22.                 Play(Music_Two,0,3,360);
  23.                 Delay1ms(500);
  24.         }
  25. }
復(fù)制代碼


音樂播放器.rar

32.91 KB, 下載次數(shù): 57, 下載積分: 黑幣 -5

回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表