色婷婷AⅤ一区二区三区|亚洲精品第一国产综合亚AV|久久精品官方网视频|日本28视频香蕉

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > 51單片機音樂播放程序

          51單片機音樂播放程序

          作者: 時間:2016-11-13 來源:網(wǎng)絡 收藏
          #include

          #include "bofangyinyue1.h"

          本文引用地址:http://cafeforensic.com/article/201611/316479.htm

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

          //*****************************Music******************************************************

          //同一首歌
          unsigned char code Music_Same[]={ 0x0F,0x01, 0x15,0x02, 0x16,0x02, 0x17,0x66, 0x18,0x03,
          0x17,0x02, 0x15,0x02, 0x16,0x01, 0x15,0x02, 0x10,0x02,
          0x15,0x00, 0x0F,0x01, 0x15,0x02, 0x16,0x02, 0x17,0x02,
          0x17,0x03, 0x18,0x03, 0x19,0x02, 0x15,0x02, 0x18,0x66,
          0x17,0x03, 0x19,0x02, 0x16,0x03, 0x17,0x03, 0x16,0x00,
          0x17,0x01, 0x19,0x02, 0x1B,0x02, 0x1B,0x70, 0x1A,0x03,
          0x1A,0x01, 0x19,0x02, 0x19,0x03, 0x1A,0x03, 0x1B,0x02,
          0x1A,0x0D, 0x19,0x03, 0x17,0x00, 0x18,0x66, 0x18,0x03,
          0x19,0x02, 0x1A,0x02, 0x19,0x0C, 0x18,0x0D, 0x17,0x03,
          0x16,0x01, 0x11,0x02, 0x11,0x03, 0x10,0x03, 0x0F,0x0C,
          0x10,0x02, 0x15,0x00, 0x1F,0x01, 0x1A,0x01, 0x18,0x66,
          0x19,0x03, 0x1A,0x01, 0x1B,0x02, 0x1B,0x03, 0x1B,0x03,
          0x1B,0x0C, 0x1A,0x0D, 0x19,0x03, 0x17,0x00, 0x1F,0x01,
          0x1A,0x01, 0x18,0x66, 0x19,0x03, 0x1A,0x01, 0x10,0x02,
          0x10,0x03, 0x10,0x03, 0x1A,0x0C, 0x18,0x0D, 0x17,0x03,
          0x16,0x00, 0x0F,0x01, 0x15,0x02, 0x16,0x02, 0x17,0x70,
          0x18,0x03, 0x17,0x02, 0x15,0x03, 0x15,0x03, 0x16,0x66,
          0x16,0x03, 0x16,0x02, 0x16,0x03, 0x15,0x03, 0x10,0x02,
          0x10,0x01, 0x11,0x01, 0x11,0x66, 0x10,0x03, 0x0F,0x0C,
          0x1A,0x02, 0x19,0x02, 0x16,0x03, 0x16,0x03, 0x18,0x66,
          0x18,0x03, 0x18,0x02, 0x17,0x03, 0x16,0x03, 0x19,0x00,
          0x00,0x00 };
          //兩只蝴蝶
          unsigned char code Music_Two[] ={ 0x17,0x03, 0x16,0x03, 0x17,0x01, 0x16,0x03, 0x17,0x03,
          0x16,0x03, 0x15,0x01, 0x10,0x03, 0x15,0x03, 0x16,0x02,
          0x16,0x0D, 0x17,0x03, 0x16,0x03, 0x15,0x03, 0x10,0x03,
          0x10,0x0E, 0x15,0x04, 0x0F,0x01, 0x17,0x03, 0x16,0x03,
          0x17,0x01, 0x16,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x01,
          0x10,0x03, 0x15,0x03, 0x16,0x02, 0x16,0x0D, 0x17,0x03,
          0x16,0x03, 0x15,0x03, 0x10,0x03, 0x15,0x03, 0x16,0x01,
          0x17,0x03, 0x16,0x03, 0x17,0x01, 0x16,0x03, 0x17,0x03,
          0x16,0x03, 0x15,0x01, 0x10,0x03, 0x15,0x03, 0x16,0x02,
          0x16,0x0D, 0x17,0x03, 0x16,0x03, 0x15,0x03, 0x10,0x03,
          0x10,0x0E, 0x15,0x04, 0x0F,0x01, 0x17,0x03, 0x19,0x03,
          0x19,0x01, 0x19,0x03, 0x1A,0x03, 0x19,0x03, 0x17,0x01,
          0x16,0x03, 0x16,0x03, 0x16,0x02, 0x16,0x0D, 0x17,0x03,
          0x16,0x03, 0x15,0x03, 0x10,0x03, 0x10,0x0D, 0x15,0x00,
          0x19,0x03, 0x19,0x03, 0x1A,0x03, 0x1F,0x03, 0x1B,0x03,
          0x1B,0x03, 0x1A,0x03, 0x17,0x0D, 0x16,0x03, 0x16,0x03,
          0x16,0x0D, 0x17,0x01, 0x17,0x03, 0x17,0x03, 0x19,0x03,
          0x1A,0x02, 0x1A,0x02, 0x10,0x03, 0x17,0x0D, 0x16,0x03,
          0x16,0x01, 0x17,0x03, 0x19,0x03, 0x19,0x03, 0x17,0x03,
          0x19,0x02, 0x1F,0x02, 0x1B,0x03, 0x1A,0x03, 0x1A,0x0E,
          0x1B,0x04, 0x17,0x02, 0x1A,0x03, 0x1A,0x03, 0x1A,0x0E,
          0x1B,0x04, 0x1A,0x03, 0x19,0x03, 0x17,0x03, 0x16,0x03,
          0x17,0x0D, 0x16,0x03, 0x17,0x03, 0x19,0x01, 0x19,0x03,
          0x19,0x03, 0x1A,0x03, 0x1F,0x03, 0x1B,0x03, 0x1B,0x03,
          0x1A,0x03, 0x17,0x0D, 0x16,0x03, 0x16,0x03, 0x16,0x03,
          0x17,0x01, 0x17,0x03, 0x17,0x03, 0x19,0x03, 0x1A,0x02,
          0x1A,0x02, 0x10,0x03, 0x17,0x0D, 0x16,0x03, 0x16,0x01,
          0x17,0x03, 0x19,0x03, 0x19,0x03, 0x17,0x03, 0x19,0x03,
          0x1F,0x02, 0x1B,0x03, 0x1A,0x03, 0x1A,0x0E, 0x1B,0x04,
          0x17,0x02, 0x1A,0x03, 0x1A,0x03, 0x1A,0x0E, 0x1B,0x04,
          0x17,0x16, 0x1A,0x03, 0x1A,0x03, 0x1A,0x0E, 0x1B,0x04,
          0x1A,0x03, 0x19,0x03, 0x17,0x03, 0x16,0x03, 0x0F,0x02,
          0x10,0x03, 0x15,0x00, 0x00,0x00 };
          //北京歡迎你
          unsigned char code Music_Code[]={ 0x17,0x03, 0x19,0x03, 0x17,0x03, 0x16,0x03, 0x17,0x03,
          0x16,0x03, 0x17,0x02, 0x17,0x67, 0x16,0x03, 0x10,0x03,
          0x15,0x03, 0x17,0x03, 0x16,0x66, 0x16,0x03, 0x15,0x03,
          0x10,0x03, 0x15,0x03, 0x16,0x03, 0x17,0x03, 0x19,0x03,
          0x16,0x03, 0x17,0x03, 0x1A,0x03, 0x19,0x03, 0x0F,0x03,
          0x16,0x03, 0x15,0x66, 0x16,0x03, 0x15,0x03, 0x10,0x03,
          0x15,0x03, 0x16,0x03, 0x17,0x03, 0x19,0x03, 0x16,0x03,
          0x17,0x03, 0x1A,0x03, 0x19,0x03, 0x19,0x03, 0x17,0x01,
          0x16,0x03, 0x17,0x03, 0x16,0x03, 0x15,0x03, 0x19,0x67,
          0x1A,0x04, 0x17,0x02, 0x10,0x03, 0x17,0x03, 0x16,0x03,
          0x16,0x03, 0x15,0x66, 0x17,0x03, 0x19,0x03, 0x1F,0x03,
          0x19,0x03, 0x1A,0x66, 0x19,0x03, 0x1A,0x03, 0x19,0x03,
          0x17,0x03, 0x17,0x03, 0x19,0x03, 0x19,0x66, 0x17,0x03,
          0x19,0x03, 0x1A,0x03, 0x1F,0x03, 0x20,0x03, 0x1F,0x03,
          0x19,0x03, 0x17,0x03, 0x16,0x03, 0x19,0x02, 0x17,0x03,
          0x17,0x01, 0x17,0x03, 0x19,0x03, 0x1F,0x03, 0x19,0x03,
          0x1A,0x66, 0x1F,0x03, 0x20,0x67, 0x1F,0x04, 0x19,0x03,
          0x17,0x03, 0x19,0x03, 0x1F,0x03, 0x1A,0x66, 0x17,0x03,
          0x16,0x03, 0x17,0x03, 0x1A,0x03, 0x21,0x03, 0x20,0x66,
          0x20,0x03, 0x1F,0x01, 0x1F,0x66, 0x17,0x03, 0x19,0x03,
          0x15,0x03, 0x19,0x03, 0x1A,0x66, 0x1F,0x03, 0x20,0x66,
          0x1F,0x04, 0x19,0x03, 0x17,0x03, 0x19,0x03, 0x1F,0x03,
          0x1A,0x66, 0x17,0x03, 0x16,0x03, 0x17,0x03, 0x1A,0x03,
          0x21,0x03, 0x20,0x0B, 0x20,0x0B, 0x20,0x0B, 0x20,0x0B,
          0x20,0x02, 0x1F,0x03, 0x1F,0x0B, 0x1F,0x0B, 0x1F,0x0B,
          0x1F,0x0B, 0x1F,0x0B, 0x00,0x00 };
          //奧運主題曲:我和你
          unsigned char code Music_Code1[]={ 0x17,0x02, 0x19,0x02, 0x15,0x01, 0x16,0x02, 0x17,0x02,
          0x0F,0x01, 0x15,0x02, 0x16,0x02, 0x17,0x02, 0x19,0x02,
          0x16,0x00, 0x17,0x02, 0x19,0x02, 0x15,0x01, 0x16,0x02,
          0x17,0x02, 0x10,0x01, 0x16,0x02, 0x0F,0x02, 0x16,0x02,
          0x17,0x02, 0x15,0x00, 0x1A,0x01, 0x19,0x01, 0x1A,0x01,
          0x15,0x01, 0x17,0x02, 0x10,0x02, 0x17,0x66, 0x19,0x03,
          0x16,0x00, 0x17,0x02, 0x19,0x02, 0x15,0x01, 0x16,0x02,
          0x17,0x02, 0x10,0x01, 0x16,0x02, 0x0F,0x02, 0x16,0x02,
          0x17,0x02, 0x15,0x00, 0x00,0x00 };
          //***********************************************************************************
          main()
          {
          InitialSound();
          while(1)
          {

          Play(Music_Same,0,3,360);
          Delay1ms(500);
          Play(Music_Two,0,3,360);
          Delay1ms(500);
          Play(Music_Code,0,3,360);
          Delay1ms(500);
          Play(Music_Code1,0,3,360);
          Delay1ms(500);
          }
          }



          關鍵詞: 51單片機音樂播

          評論


          技術專區(qū)

          關閉