資源簡介
可以把音樂簡譜轉換成十六進制的tool;

代碼片段和文件信息
#include?“reg52.h“
unsigned?char?Count;
sbit?_Speak?=P2^3?; //訊響器控制腳
unsigned?char?code?SONG[]?={??????//祝你平安
0x260x200x200x200x200x200x260x100x200x100x200x800x260x200x300x20
0x300x200x390x100x300x100x300x800x260x200x200x200x200x200x1c0x20
0x200x800x2b0x200x260x200x200x200x2b0x100x260x100x2b0x800x260x20
0x300x200x300x200x390x100x260x100x260x600x400x100x390x100x260x20
0x300x200x300x200x390x100x260x100x260x800x260x200x2b0x100x2b0x10
0x2b0x200x300x100x390x100x260x100x2b0x100x2b0x200x2b0x400x400x20
0x200x100x200x100x2b0x100x260x300x300x800x180x200x180x200x260x20
0x200x200x200x400x260x200x2b0x200x300x200x300x200x1c0x200x200x20
0x200x800x1c0x200x1c0x200x1c0x200x300x200x300x600x390x100x300x10
0x200x200x2b0x100x260x100x2b0x100x260x100x260x100x2b0x100x2b0x80
0x180x200x180x200x260x200x200x200x200x600x260x100x2b0x200x300x20
0x300x200x1c0x200x200x200x200x800x260x200x300x100x300x100x300x20
0x390x200x260x100x2b0x100x2b0x200x2b0x400x400x100x400x100x200x10
0x200x100x2b0x100x260x300x300x800x00
??????????????????????????????????//路邊的野華不要采
0x300x1C0x100x200x400x1C0x100x180x100x200x100x1C0x100x180x400x1C
0x200x200x200x1C0x200x180x200x200x800xFF0x200x300x1C0x100x180x20
0x150x200x1C0x200x200x200x260x400x200x200x2B0x200x260x200x200x20
0x300x800xFF0x200x200x1C0x100x180x100x200x200x260x200x2B0x200x30
0x200x2B0x400x200x200x1C0x100x180x100x200x200x260x200x2B0x200x30
0x200x2B0x400x200x300x1C0x100x180x200x150x200x1C0x200x200x200x26
0x400x200x200x2B0x200x260x200x200x200x300x800x200x300x1C0x100x20
0x100x1C0x100x200x200x260x200x2B0x200x300x200x2B0x400x200x150x1F
0x050x200x100x1C0x100x200x200x260x200x2B0x200x300x200x2B0x400x20
0x300x1C0x100x180x200x150x200x1C0x200x200x200x260x400x200x200x2B
0x200x260x200x200x200x300x300x200x300x1C0x100x180x400x1C0x200x20
0x200x260x400x130x600x180x200x150x400x130x400x180x800x00
};
void?Time0_Init()
{
TMOD?=?0x01;
IE? ?=?0x82;
TH0??=?0xD8;
TL0??=?0xEF; //12MZ晶振,10ms
}
void?Time0_Int()?interrupt?1
{
TH0?=?0xD8;
TL0?=?0xEF;
Count++; //長度加1
}
/*-------------------------------------------------
功能:1MS延時子程序
-------------------------------------------------*/
void?Delay_xMs(unsigned?int?x)
{
????unsigned?int?ij;
????for(?i?=0;i?????{
????????for(?j?=0;j<3;j++?);
????}
}
/*-------------------------------------------------
功能:歌曲播放子程序i為播放哪一段曲目
-------------------------------------------------*/
void?Play_Song(unsigned?char?i)
{
unsigned?char?Temp1Temp2;
unsigned?int?Addr;
Count?=?0; //中斷計數器清0
Addr?=?i?*?217;
while(1)
{
Temp1?=?SONG[Addr++];
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3707??2010-05-25?22:18??main.c
?????文件?????224768??2010-05-26?11:09??單片機音樂轉換.exe
-----------?---------??----------?-----??----
???????????????228475????????????????????2
- 上一篇:心音聽診wav格式記錄的波形數據
- 下一篇:SPOOLING假脫機技術模擬
評論
共有 條評論